#[macro_use]
extern crate structopt;
use structopt::StructOpt;
#[derive(StructOpt, Debug)]
#[structopt(name = "rename_all", rename_all = "screaming_snake_case")]
enum Opt {
FirstCommand {
#[structopt(long, short)]
foo: bool,
},
#[structopt(rename_all = "pascal_case")]
SecondCommand {
#[structopt(rename_all = "snake_case", long)]
bar_option: bool,
#[structopt(subcommand)]
cmds: Subcommands,
#[structopt(flatten)]
options: BonusOptions,
},
}
#[derive(StructOpt, Debug)]
enum Subcommands {
FirstSubcommand,
}
#[derive(StructOpt, Debug)]
struct BonusOptions {
#[structopt(long)]
baz_option: bool,
}
fn main() {
let opt = Opt::from_args();
println!("{:?}", opt);
}