aboutsummaryrefslogtreecommitdiff
path: root/3.2.23/examples/tutorial_derive/03_01_flag_count.rs
blob: 680f7f5e526f3237f68130c3f561ca43671f25a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use clap::Parser;

#[derive(Parser)]
#[clap(author, version, about, long_about = None)]
struct Cli {
    #[clap(short, long, action = clap::ArgAction::Count)]
    verbose: u8,
}

fn main() {
    let cli = Cli::parse();

    println!("verbose: {:?}", cli.verbose);
}