only check initial argument
This commit is contained in:
parent
08dcdd6015
commit
b27b948719
1 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue