summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 4d56375..c27bad7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -108,10 +108,19 @@ fn eval(paths: &[&str], prompt: &str) {
}
// Run the command (and wait for it to finish)
- let mut child = match Command::new(cmd).args(args).spawn() {
+ let mut child = match Command::new(&cmd).args(args).spawn() {
Ok(ch) => ch,
- Err(_) => {
- println!("Unable to fork");
+ Err(err) => {
+ match err.kind() {
+ std::io::ErrorKind::PermissionDenied => println!(
+ "dwvsh: error: permission denied trying to fork to {}...",
+ &cmd
+ ),
+ // TODO: Refresh paths if error kind is NotFound
+ std::io::ErrorKind::NotFound => println!("dwvsh: error: command not found..."),
+ _ => println!("dwvsh: error: unable to fork..."),
+ }
+
continue;
}
};