clap/clap_derive/examples/arg_enum.rs
2020-04-22 14:37:45 +02:00

19 lines
260 B
Rust

use clap::Clap;
#[derive(Clap, Debug, PartialEq)]
enum ArgChoice {
Foo,
Bar,
Baz,
}
#[derive(Clap, PartialEq, Debug)]
struct Opt {
#[clap(arg_enum)]
arg: ArgChoice,
}
fn main() {
let opt = Opt::parse();
println!("{:#?}", opt);
}