aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_cli/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_cli/src/main.rs')
-rw-r--r--crates/ra_cli/src/main.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs
index 8b91ba3e9..2405eb4f4 100644
--- a/crates/ra_cli/src/main.rs
+++ b/crates/ra_cli/src/main.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1mod analysis_stats; 3mod analysis_stats;
2mod analysis_bench; 4mod analysis_bench;
3mod help; 5mod help;
@@ -93,7 +95,7 @@ fn main() -> Result<()> {
93 (true, true) => Err("Invalid flags: -q conflicts with -v")?, 95 (true, true) => Err("Invalid flags: -q conflicts with -v")?,
94 }; 96 };
95 let memory_usage = matches.contains("--memory-usage"); 97 let memory_usage = matches.contains("--memory-usage");
96 let only: Option<String> = matches.value_from_str(["-o", "--only"])?; 98 let only: Option<String> = matches.opt_value_from_str(["-o", "--only"])?;
97 let path = { 99 let path = {
98 let mut trailing = matches.free()?; 100 let mut trailing = matches.free()?;
99 if trailing.len() != 1 { 101 if trailing.len() != 1 {
@@ -115,9 +117,9 @@ fn main() -> Result<()> {
115 return Ok(()); 117 return Ok(());
116 } 118 }
117 let verbose = matches.contains(["-v", "--verbose"]); 119 let verbose = matches.contains(["-v", "--verbose"]);
118 let path: String = matches.value_from_str("--path")?.unwrap_or_default(); 120 let path: String = matches.opt_value_from_str("--path")?.unwrap_or_default();
119 let highlight_path = matches.value_from_str("--highlight")?; 121 let highlight_path = matches.opt_value_from_str("--highlight")?;
120 let complete_path = matches.value_from_str("--complete")?; 122 let complete_path = matches.opt_value_from_str("--complete")?;
121 if highlight_path.is_some() && complete_path.is_some() { 123 if highlight_path.is_some() && complete_path.is_some() {
122 panic!("either --highlight or --complete must be set, not both") 124 panic!("either --highlight or --complete must be set, not both")
123 } 125 }