clap/tests/derive_ui/bool_value_enum.rs

14 lines
217 B
Rust
Raw Normal View History

use clap::Parser;
2020-04-22 07:25:41 +00:00
#[derive(Parser, Debug)]
#[command(name = "basic")]
2020-04-22 07:25:41 +00:00
struct Opt {
#[arg(short, value_enum, default_value_t)]
2020-04-22 07:25:41 +00:00
opts: bool,
}
fn main() {
let opt = Opt::parse();
println!("{opt:?}");
2020-04-22 07:25:41 +00:00
}