mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-19 02:10:34 +01:00
Update error message if command could not be found
This commit is contained in:
parent
3c5d8a1e86
commit
5ed7514096
1 changed files with 14 additions and 2 deletions
|
@ -32,7 +32,13 @@ pub fn execute_command(mut cmd: Command, out_perm: Arc<Mutex<()>>) {
|
||||||
let _ = stdout.lock().write_all(&output.stdout);
|
let _ = stdout.lock().write_all(&output.stdout);
|
||||||
let _ = stderr.lock().write_all(&output.stderr);
|
let _ = stderr.lock().write_all(&output.stderr);
|
||||||
}
|
}
|
||||||
Err(why) => eprintln!("fd: exec error: {}", why),
|
Err(why) => {
|
||||||
|
if why.kind() == io::ErrorKind::NotFound {
|
||||||
|
eprintln!("fd: execution error: command not found");
|
||||||
|
} else {
|
||||||
|
eprintln!("fd: execution error: {}", why);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,6 +99,12 @@ pub fn execute_command(mut cmd: Command, out_perm: Arc<Mutex<()>>) {
|
||||||
let _ = io::copy(&mut pout, &mut stdout.lock());
|
let _ = io::copy(&mut pout, &mut stdout.lock());
|
||||||
let _ = io::copy(&mut perr, &mut stderr.lock());
|
let _ = io::copy(&mut perr, &mut stderr.lock());
|
||||||
}
|
}
|
||||||
Err(why) => eprintln!("fd: exec error: {}", why),
|
Err(why) => {
|
||||||
|
if why.kind() == io::ErrorKind::NotFound {
|
||||||
|
eprintln!("fd: execution error: command not found");
|
||||||
|
} else {
|
||||||
|
eprintln!("fd: execution error: {}", why);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue