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