From 1fb3db92f1f068ff653b76c4c142098243cb1d3c Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sat, 27 Aug 2022 18:04:00 -0400 Subject: [PATCH] Add --quiet flag --- src/bin/rust_python_linter.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/bin/rust_python_linter.rs b/src/bin/rust_python_linter.rs index 526225b996..8667486af8 100644 --- a/src/bin/rust_python_linter.rs +++ b/src/bin/rust_python_linter.rs @@ -26,6 +26,8 @@ struct Cli { #[clap(short, long, action)] verbose: bool, #[clap(short, long, action)] + quiet: bool, + #[clap(short, long, action)] watch: bool, #[clap(short, long, action)] no_cache: bool, @@ -105,7 +107,9 @@ fn main() -> Result<()> { tell_user!("Starting linter in watch mode...\n"); let messages = run_once(&cli.files, &settings, !cli.no_cache)?; - report_continuously(&messages)?; + if !cli.quiet { + report_continuously(&messages)?; + } // Configure the file watcher. let (tx, rx) = channel(); @@ -123,7 +127,9 @@ fn main() -> Result<()> { tell_user!("File change detected...\n"); let messages = run_once(&cli.files, &settings, !cli.no_cache)?; - report_continuously(&messages)?; + if !cli.quiet { + report_continuously(&messages)?; + } } } } @@ -132,7 +138,9 @@ fn main() -> Result<()> { } } else { let messages = run_once(&cli.files, &settings, !cli.no_cache)?; - report_once(&messages)?; + if !cli.quiet { + report_once(&messages)?; + } } Ok(())