From bdca31c3fd5a6ccfa06c2d220a447bc14759f600 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Thu, 22 Dec 2016 14:10:53 -0500 Subject: [PATCH] main: fix bad usage error handling --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8d75d3d..f8b7fbf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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") {