diff --git a/bin/src/main.rs b/bin/src/main.rs index 7e23d5b7..925fb49f 100644 --- a/bin/src/main.rs +++ b/bin/src/main.rs @@ -94,11 +94,15 @@ fn get_commands() -> Vec { execs } +fn find_command() -> Option { + env::args().skip(1).filter(|x| !x.starts_with("-")).next() +} + fn main() { let commands = get_commands(); let mut args = env::args(); let _ = args.next(); - let first_arg = match args.next() { + let first_arg = match find_command() { Some(s) => s, None => { help(commands);