Skip to content

Commit

Permalink
fix!: Make logging flags global
Browse files Browse the repository at this point in the history
This will carry them across subcommands

Fixes #33
  • Loading branch information
epage committed Feb 9, 2022
1 parent b678abe commit 4c0c95d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib.rs
Expand Up @@ -35,11 +35,17 @@ pub struct Verbosity {
///
/// By default, it'll only report errors. Passing `-v` one time also prints
/// warnings, `-vv` enables info logging, `-vvv` debug, and `-vvvv` trace.
#[clap(long, short = 'v', parse(from_occurrences))]
#[clap(long, short = 'v', parse(from_occurrences), global = true)]
verbose: i8,

/// Pass many times for less log output
#[clap(long, short = 'q', parse(from_occurrences), conflicts_with = "verbose")]
#[clap(
long,
short = 'q',
parse(from_occurrences),
global = true,
conflicts_with = "verbose"
)]
quiet: i8,

#[clap(skip)]
Expand Down

0 comments on commit 4c0c95d

Please sign in to comment.