From 775344e98cb3f88c3c1339bb7bd4998ca6d33b93 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 26 Oct 2018 04:46:05 +0200 Subject: print_usage(): Exit after printing usage Otherwise we might end up printing things like error messages from the license check. Not very nice-looking to have that after the help message output. --- src/config.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/config.rs b/src/config.rs index 6b9d673..01cc379 100644 --- a/src/config.rs +++ b/src/config.rs @@ -2,6 +2,7 @@ use std::ffi::CString; use std::fs; use std::ptr; +use exitcode; use libc::c_char; use getopts::Options; use toml; @@ -52,6 +53,8 @@ impl Default for Config { fn print_usage(opts: Options) { let brief = "Usage: dome-key [options]"; print!("{}", opts.usage(&brief)); + + ::std::process::exit(exitcode::OK); } pub fn parse_args<'a>(args: &[String], config: &'a mut Config) -> &'a mut Config { -- cgit v1.2.3