main: fix bad usage error handling

This commit is contained in:
Matteo Cypriani 2016-12-22 14:10:53 -05:00
parent 20f4e61f26
commit bdca31c3fd
1 changed files with 5 additions and 2 deletions

View File

@ -55,8 +55,11 @@ fn main_main() -> i32 {
"print this help message"); "print this help message");
let options = match opts.parse(&args[1..]) { let options = match opts.parse(&args[1..]) {
Ok(m) => m, Ok(options) => options,
Err(err) => panic!(err), Err(_) => {
print_usage(&prog_name, &opts);
return 1;
},
}; };
if options.opt_present("help") { if options.opt_present("help") {