mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
20 lines
260 B
Rust
20 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);
|
||
|
}
|