Debian Codegraph @

third_party/rust/clap/examples/tutorial_builder/03_01_flag_bool.rs

raw
1 use clap::{command, Arg, ArgAction};
2
3 fn main() {
4 let matches = command!() // requires `cargo` feature
5 .arg(
6 Arg::new("verbose")
7 .short('v')
8 .long("verbose")
9 .action(ArgAction::SetTrue),
10 )
11 .get_matches();
12
13 println!("verbose: {:?}", matches.get_flag("verbose"));
14 }