Browse Source

feat: add exit shell error

main
fdai7381 2 years ago
parent
commit
5f399c0839
  1. 1
      src/error.rs
  2. 3
      src/main.rs

1
src/error.rs

@ -2,6 +2,7 @@ use std::process::Command;
pub enum ShellError {
EmptyLine,
Exit,
NotFound(Command),
ExecuteFailure(String),
}

3
src/main.rs

@ -25,6 +25,9 @@ fn main() -> Result<()> {
Err(ShellError::EmptyLine) => {
continue;
}
Err(ShellError::Exit) => {
break;
}
Err(ShellError::NotFound(cmd)) => {
println!("{}: command not found", cmd.get_program().to_string_lossy())
}

Loading…
Cancel
Save