use clap::{CommandFactory, Parser, Subcommand};
#[derive(Parser)]
struct Cli {
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand)]
enum Commands {
Completions {
#[arg(value_enum)]
shell: clap_complete_command::Shell,
},
}
fn main() {
let cli = Cli::parse();
match cli.command {
Commands::Completions { shell } => {
shell.generate(&mut Cli::command(), &mut std::io::stdout());
}
}
}