diff --git a/src/commands.rs b/src/commands.rs index 06cd1da..1d63784 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -44,7 +44,13 @@ impl Add { return ExitCode::DuplicateCommand; } - if Command::new(&self.original).output().is_err() { + let command = &self + .original + .split_whitespace() + .next() + .expect("command should be provided"); + + if Command::new(command).output().is_err() { eprintln!("Command not found: {}", self.original); return ExitCode::CommandFailed; }