use clap::Clap; #[derive(Clap, Debug)] struct Opt { #[clap(subcommand)] cmd: Command, } #[derive(Clap, Debug)] enum Command { #[clap(external_subcommand)] Run(Vec), #[clap(external_subcommand)] Other(Vec), } fn main() { let opt = Opt::parse(); println!("{:?}", opt); }