From 4c0c95d1cf2684d60c345845d913466dd1090b04 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 9 Feb 2022 09:20:38 -0600 Subject: [PATCH] fix!: Make logging flags global This will carry them across subcommands Fixes #33 --- src/lib.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 08d12c3..6ba8f3d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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)]