use {argh::FromArgs, std::fmt::Debug};
#[derive(FromArgs, PartialEq, Debug)]
struct TopLevel {
#[argh(subcommand)]
nested: MySubCommandEnum,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand)]
enum MySubCommandEnum {
One(SubCommandOne),
Two(SubCommandTwo),
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "one", short = 'o')]
struct SubCommandOne {
#[argh(option)]
x: usize,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "two")]
struct SubCommandTwo {
#[argh(switch)]
fooey: bool,
#[argh(option)]
woot: Woot,
}
#[derive(argh::FromArgValue, PartialEq, Debug)]
enum Woot {
Quiet,
Loud,
}
fn main() {
let toplevel: TopLevel = argh::from_env();
println!("{:#?}", toplevel);
}