Skip to content

Commit

Permalink
feat(example): add example for changing default Level
Browse files Browse the repository at this point in the history
  • Loading branch information
pitoniak32 committed Feb 19, 2024
1 parent 42895a2 commit a1b2f8d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/default_level.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use clap::Parser;
use clap_verbosity_flag::{InfoLevel, Verbosity};

#[derive(Debug, Parser)]
struct DefaultCli {
#[command(flatten)]
verbose: Verbosity,
}

#[derive(Debug, Parser)]
struct InfoCli {
#[command(flatten)]
verbose: Verbosity<InfoLevel>,
}

fn main() {
let error_cli = DefaultCli::parse();

dbg!(&error_cli.verbose);

let info_cli = InfoCli::parse();

dbg!(&info_cli.verbose);
}

0 comments on commit a1b2f8d

Please sign in to comment.