Skip to content

Commit

Permalink
feat: add OffLevel to available Verbosity default options
Browse files Browse the repository at this point in the history
  • Loading branch information
pitoniak32 committed Feb 19, 2024
1 parent 8bfdbd3 commit 593a711
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ pub struct Verbosity<L: LogLevel = ErrorLevel> {
help = L::quiet_help(),
long_help = L::quiet_long_help(),
conflicts_with = "verbose",
hide(L::default().is_none())
)]
quiet: u8,

Expand Down Expand Up @@ -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<log::Level> {
None
}
}

#[cfg(test)]
mod test {
use super::*;
Expand Down

0 comments on commit 593a711

Please sign in to comment.