diff --git a/src/command.rs b/src/command.rs index d46b1a3..d013279 100644 --- a/src/command.rs +++ b/src/command.rs @@ -12,6 +12,10 @@ impl ExitCode { pub fn get(&self) -> u8 { self.exit_code } + + pub fn not_found() -> Self { + Self { exit_code: 127 } + } } pub trait Command { @@ -99,7 +103,7 @@ impl Command for UnixProgram { } else { let message = format!("{}: command not found", &program); error::print_error(message); - ExitCode::new(127) + ExitCode::not_found() } } }