aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-02-17 16:12:37 +0000
committerAleksey Kladov <[email protected]>2020-02-17 16:12:37 +0000
commit0353e1c6f4eb0f9351f9a75f5fef016d6ac7960b (patch)
tree537f7e23f65a762820846bdfa4892641175528df /crates
parent57140f1730b4ac39697bfad530409ac8472e4e9d (diff)
Use Arguments::from_os
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_cli/src/main.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs
index 750cbab86..f0daaaf15 100644
--- a/crates/ra_cli/src/main.rs
+++ b/crates/ra_cli/src/main.rs
@@ -40,16 +40,10 @@ impl Verbosity {
40fn main() -> Result<()> { 40fn main() -> Result<()> {
41 env_logger::try_init()?; 41 env_logger::try_init()?;
42 42
43 let subcommand = match std::env::args_os().nth(1) { 43 let mut matches = Arguments::from_env();
44 None => { 44 let subcommand = matches.subcommand()?.unwrap_or_default();
45 eprintln!("{}", help::GLOBAL_HELP);
46 return Ok(());
47 }
48 Some(s) => s,
49 };
50 let mut matches = Arguments::from_vec(std::env::args_os().skip(2).collect());
51 45
52 match &*subcommand.to_string_lossy() { 46 match subcommand.as_str() {
53 "parse" => { 47 "parse" => {
54 if matches.contains(["-h", "--help"]) { 48 if matches.contains(["-h", "--help"]) {
55 eprintln!("{}", help::PARSE_HELP); 49 eprintln!("{}", help::PARSE_HELP);