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");
let options = match opts.parse(&args[1..]) {
Ok(m) => m,
Err(err) => panic!(err),
Ok(options) => options,
Err(_) => {
print_usage(&prog_name, &opts);
return 1;
},
};
if options.opt_present("help") {