From 1720b5b9ce33b87b204769e70207151d84166df1 Mon Sep 17 00:00:00 2001 From: kraktus Date: Thu, 20 Oct 2022 13:21:34 +0200 Subject: [PATCH] WIP --- lintcheck/src/config.rs | 28 ++++++++++++++++------------ lintcheck/src/main.rs | 4 +--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lintcheck/src/config.rs b/lintcheck/src/config.rs index c8ade48decc2..12ff42bfc3a0 100644 --- a/lintcheck/src/config.rs +++ b/lintcheck/src/config.rs @@ -43,8 +43,9 @@ fn get_clap_config() -> ArgMatches { .conflicts_with("fix"), Arg::new("verbose") .short('v') + .long("--verbose") .action(ArgAction::Count) - .help("Verbosity to use, default to WARN") + .help("Verbosity to use, default to WARN"), ]) .get_matches() } @@ -74,17 +75,20 @@ impl LintcheckConfig { let clap_config = get_clap_config(); let mut builder = Builder::new(); builder - .filter( - None, - match clap_config.get_count("verbose") { - 0 => LevelFilter::Warn, - 1 => LevelFilter::Info, - 2 => LevelFilter::Debug, - _ => LevelFilter::Trace, - }, - ) - .default_format() - .init(); + .filter( + None, + match clap_config.get_count("verbose") { + 0 => LevelFilter::Warn, + 1 => LevelFilter::Info, + 2 => dbg!(LevelFilter::Debug), + _ => LevelFilter::Trace, + }, + ) + .default_format() + .init(); + assert_eq!(clap_config.get_count("verbose"), 2); + log::debug!("Test"); + println!("{:?}", builder); // first, check if we got anything passed via the LINTCHECK_TOML env var, // if not, ask clap if we got any value for --crates-toml diff --git a/lintcheck/src/main.rs b/lintcheck/src/main.rs index 4ed65d2e9e01..c9f3646109fe 100644 --- a/lintcheck/src/main.rs +++ b/lintcheck/src/main.rs @@ -410,9 +410,7 @@ impl Crate { let status = &all_output.status; if !status.success() { - warn!("bad exit status after checking {} {} \n", - self.name, self.version - ); + warn!("bad exit status after checking {} {} \n", self.name, self.version); } if config.fix {