diff options
author | Aleksey Kladov <[email protected]> | 2019-09-12 09:14:09 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-09-12 09:14:09 +0100 |
commit | 81e216a079a94aa598ac5cce3c21ca663a651195 (patch) | |
tree | 0d43b7305d9b04b8ab520fca0b555f1b8d217ecb | |
parent | 6ce6744e18f25ebcde387178125d820686692df5 (diff) |
analysis stats uses positional arg again
-rw-r--r-- | crates/ra_cli/src/main.rs | 10 |
1 files changed, 8 insertions, 2 deletions
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<()> { | |||
69 | } | 69 | } |
70 | let verbose = matches.contains(["-v", "--verbose"]); | 70 | let verbose = matches.contains(["-v", "--verbose"]); |
71 | let memory_usage = matches.contains("--memory-usage"); | 71 | let memory_usage = matches.contains("--memory-usage"); |
72 | let path: String = matches.value_from_str("--path")?.unwrap_or_default(); | ||
73 | let only = matches.value_from_str(["-o", "--only"])?.map(|v: String| v.to_owned()); | 72 | let only = matches.value_from_str(["-o", "--only"])?.map(|v: String| v.to_owned()); |
74 | matches.finish().or_else(handle_extra_flags)?; | 73 | let path = { |
74 | let mut trailing = matches.free()?; | ||
75 | if trailing.len() != 1 { | ||
76 | eprintln!("{}", help::ANALYSIS_STATS_HELP); | ||
77 | Err("Invalid flags")?; | ||
78 | } | ||
79 | trailing.pop().unwrap() | ||
80 | }; | ||
75 | analysis_stats::run( | 81 | analysis_stats::run( |
76 | verbose, | 82 | verbose, |
77 | memory_usage, | 83 | memory_usage, |