mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
19 lines
260 B
Rust
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);
|
|
}
|