main
elfeiin 2024-02-09 19:21:38 -08:00
parent ab96d1babf
commit 9fca3b6a06
Signed by: elfein
GPG Key ID: A53FDD4FD091A276
2 changed files with 9 additions and 2 deletions

View File

@ -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.",

View File

@ -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 {