diff --git a/bin/src/main.rs b/bin/src/main.rs index 32723dc3..8c95adcf 100644 --- a/bin/src/main.rs +++ b/bin/src/main.rs @@ -99,6 +99,10 @@ fn find_command() -> Option { env::args().skip(1).filter(|x| !x.starts_with("-")).next() } +fn find_flag() -> Option { + env::args().skip(1).filter(|x| x.starts_with("-")).next() +} + fn find_args(command: &str) -> Vec { env::args() .skip(1) @@ -113,9 +117,12 @@ fn main() { let _ = args.next(); let first_arg = match find_command() { Some(s) => s, - None => { - help(commands); - exit(0); + None => match find_flag() { + Some(s) => s, + None => { + help(commands); + exit(0); + }, }, };