Skip to main content

#
03_01_flag_count_derive/
03_01_flag_count.rs

    1use clap::Parser;
    2
    3#[derive(Parser)]
    4#[command(version, about, long_about = None)]
    5struct Cli {
    6    #[arg(short, long, action = clap::ArgAction::Count)]
    7    verbose: u8,
    8}
    9
    10fn main() {
    11    let cli = Cli::parse();
    12
    13    println!("verbose: {:?}", cli.verbose);
    14}