diff options
Diffstat (limited to 'crates/ra_cli')
-rw-r--r-- | crates/ra_cli/src/main.rs | 12 |
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 { | |||
40 | fn main() -> Result<()> { | 40 | fn 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); |