From 81e216a079a94aa598ac5cce3c21ca663a651195 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 12 Sep 2019 11:14:09 +0300 Subject: analysis stats uses positional arg again --- crates/ra_cli/src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'crates/ra_cli') diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index e6334cf56..23bb83ff1 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs @@ -69,9 +69,15 @@ fn main() -> Result<()> { } let verbose = matches.contains(["-v", "--verbose"]); let memory_usage = matches.contains("--memory-usage"); - let path: String = matches.value_from_str("--path")?.unwrap_or_default(); let only = matches.value_from_str(["-o", "--only"])?.map(|v: String| v.to_owned()); - matches.finish().or_else(handle_extra_flags)?; + let path = { + let mut trailing = matches.free()?; + if trailing.len() != 1 { + eprintln!("{}", help::ANALYSIS_STATS_HELP); + Err("Invalid flags")?; + } + trailing.pop().unwrap() + }; analysis_stats::run( verbose, memory_usage, -- cgit v1.2.3