diff --git a/src/app.rs b/src/app.rs index dd9dae7..8d9b19b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -94,7 +94,7 @@ impl AppOption { "--close-from n | -C n", "Close all file descriptors greater than or equal to n.", ), - AppOption::GenerateConfig => ("--gen-config", "Print example config to standard output."), + AppOption::GenerateConfig => ("--gen-conf", "Print example config to standard output."), AppOption::Group => ( "--group | -g", "Run the command with the primary group set to group.", diff --git a/src/main.rs b/src/main.rs index 9857ee3..c8f9bfc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -81,7 +81,14 @@ pub fn execute(app: App) -> Result<(), String> { cmd.env("HOME", home_dir); } // execute the child - let mut child = cmd.spawn().unwrap(); + let mut child = if let Ok(child) = cmd.spawn() { + child + } else { + return Err(format![ + "Error: {}: Command not found.", + args.first().unwrap() + ]); + }; if app.background { std::process::exit(0); } else {