From 593a7117ce53adc40176f6a2a95ac6986f1f8223 Mon Sep 17 00:00:00 2001 From: David Pitoniak Date: Mon, 19 Feb 2024 17:46:26 -0500 Subject: [PATCH] feat: add OffLevel to available Verbosity default options --- src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 623262d..afcb82a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -82,6 +82,7 @@ pub struct Verbosity { help = L::quiet_help(), long_help = L::quiet_long_help(), conflicts_with = "verbose", + hide(L::default().is_none()) )] quiet: u8, @@ -210,6 +211,18 @@ impl LogLevel for InfoLevel { } } +/// Default to [`None`] +/// +/// Will disable the `--quiet` / `-q` flag. +#[derive(Copy, Clone, Debug, Default)] +pub struct OffLevel; + +impl LogLevel for OffLevel { + fn default() -> Option { + None + } +} + #[cfg(test)] mod test { use super::*;