diff --git a/src/error.rs b/src/error.rs index 46bbb99..76a2717 100644 --- a/src/error.rs +++ b/src/error.rs @@ -2,6 +2,7 @@ use std::process::Command; pub enum ShellError { EmptyLine, + Exit, NotFound(Command), ExecuteFailure(String), } diff --git a/src/main.rs b/src/main.rs index c19774c..c627e9d 100644 --- a/src/main.rs +++ b/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()) }