main: fix bad usage error handling
This commit is contained in:
parent
20f4e61f26
commit
bdca31c3fd
|
@ -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") {
|
||||||
|
|
Loading…
Reference in New Issue