use std::fmt::Debug;
use argp::FromArgs;
#[derive(FromArgs, PartialEq, Debug)]
struct TopLevel {
#[argp(switch, global)]
verbose: bool,
#[argp(subcommand)]
nested: MySubCommandEnum,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argp(subcommand)]
enum MySubCommandEnum {
One(SubCommandOne),
Two(SubCommandTwo),
}
#[derive(FromArgs, PartialEq, Debug)]
#[argp(subcommand, name = "one")]
struct SubCommandOne {
#[argp(option)]
x: usize,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argp(subcommand, name = "two")]
struct SubCommandTwo {
#[argp(switch)]
fooey: bool,
}
fn main() {
let toplevel: TopLevel = argp::parse_args_or_exit(argp::DEFAULT);
println!("{:#?}", toplevel);
}