only check initial argument

This commit is contained in:
Josh Thomas 2024-12-14 00:27:05 -06:00
parent 08dcdd6015
commit b27b948719

View file

@ -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;
}