From 673eb691e99629543f3b196908a5785b095d6e68 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Tue, 9 Jul 2024 19:34:46 +0200 Subject: [PATCH] fix(cli): clap count parser only works with u8, so revert the change to i8 back --- members/libpt-cli/src/args.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/members/libpt-cli/src/args.rs b/members/libpt-cli/src/args.rs index 34dd0fa..90edbf5 100644 --- a/members/libpt-cli/src/args.rs +++ b/members/libpt-cli/src/args.rs @@ -101,12 +101,12 @@ pub struct VerbosityLevel { #[arg( long, short = 'v', - action = clap::ArgAction::Count, + action = clap::ArgAction::Count, // NOTE: this forces u8 type for some reason global = true, // help = L::verbose_help(), // long_help = L::verbose_long_help(), )] - verbose: i8, + verbose: u8, /// make the output less verbose /// @@ -118,7 +118,7 @@ pub struct VerbosityLevel { global = true, conflicts_with = "verbose", )] - quiet: i8, + quiet: u8, } impl VerbosityLevel { @@ -131,7 +131,7 @@ impl VerbosityLevel { } #[inline] #[must_use] - fn value(&self) -> i8 { + fn value(&self) -> u8 { Self::level_value(Level::INFO) .saturating_sub((self.quiet).min(10)) .saturating_add((self.verbose).min(10)) @@ -189,7 +189,7 @@ impl VerbosityLevel { #[inline] #[must_use] - const fn level_value(level: Level) -> i8 { + const fn level_value(level: Level) -> u8 { match level { Level::TRACE => 4, Level::DEBUG => 3,