| 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::Count), |
| 10 | ) |
| 11 | .get_matches(); |
| 12 | |
| 13 | println!("verbose: {:?}", matches.get_count( "verbose")); |
| 14 | } |
| 15 |
