Skip to content

Commit

Permalink
Add --quiet flag to suppress warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
WGUNDERWOOD committed Sep 3, 2024
1 parent 7f77eef commit 4e217c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ const fn get_log_level(args: &Cli) -> LevelFilter {
LevelFilter::Trace
} else if args.verbose {
LevelFilter::Info
} else if args.quiet {
LevelFilter::Error
} else {
LevelFilter::Warn
}
Expand Down
3 changes: 3 additions & 0 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub struct Cli {
pub keep: bool,
#[arg(long, short, help = "Show info log messages")]
pub verbose: bool,
#[arg(long, short, help = "Hide warning messages")]
pub quiet: bool,
#[arg(long, short, help = "Show trace log messages")]
pub trace: bool,
#[arg(required = true)]
Expand All @@ -41,6 +43,7 @@ impl Cli {
print: false,
keep: false,
verbose: false,
quiet: false,
trace: false,
files: Vec::<String>::new(),
}
Expand Down

0 comments on commit 4e217c7

Please sign in to comment.