• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use clap::Parser;
2 
3 #[derive(Parser, Debug)]
4 struct Opt {
5     #[command(subcommand)]
6     cmd: Command,
7 }
8 
9 #[derive(Parser, Debug)]
10 enum Command {
11     #[command(external_subcommand)]
12     Run(Vec<String>),
13 
14     #[command(external_subcommand)]
15     Other(Vec<String>),
16 }
17 
main()18 fn main() {
19     let opt = Opt::parse();
20     println!("{:?}", opt);
21 }
22