mod init; use clap::Parser; #[derive(Parser, Debug)] #[clap(version = clap::crate_version!(), author = clap::crate_authors!(), about = clap::crate_description!())] struct Commands { #[clap(subcommand)] command: Command, } #[derive(Parser, Debug)] enum Command { Init, #[clap(subcommand)] Server(Server), } #[derive(Parser, Debug)] enum Server { Init, Start, } fn main() { let commands = Commands::parse(); match commands.command { Command::Init => { println!("Init command"); init::run(); } Command::Server(server) => match server { Server::Init => { println!("Server Init command"); } Server::Start => { println!("Server Start command"); } }, } }