diff --git a/.gitignore b/.gitignore index 184feba..b0e1363 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /proc_macros/target .vscode/ test/ +.workspace/ diff --git a/src/main.rs b/src/main.rs index 05fe7dd..00aab34 100644 --- a/src/main.rs +++ b/src/main.rs @@ -112,7 +112,7 @@ impl Main { pub fn run(&mut self) -> i32 { self.cmd = opts::parse_cmd(); if self.cmd.is_none() { - return 0; + return 1; } let cmd = self.cmd.as_ref().unwrap(); self.settings = Some(SettingStore::default()); diff --git a/src/opts.rs b/src/opts.rs index 45d3453..e1fb181 100644 --- a/src/opts.rs +++ b/src/opts.rs @@ -191,7 +191,8 @@ pub fn parse_cmd() -> Option { let result = match opts.parse(&argv[1..]) { Ok(m) => m, Err(err) => { - panic!("{}", err.to_string()) + println!("{}", err.to_string()); + return None; } }; if result.opt_present("h") || result.free.len() == 0 {