command : suppression d'un autre nombre magique
This commit is contained in:
parent
529d5fdb81
commit
557f196fe9
1 changed files with 5 additions and 1 deletions
|
@ -12,6 +12,10 @@ impl ExitCode {
|
||||||
pub fn get(&self) -> u8 {
|
pub fn get(&self) -> u8 {
|
||||||
self.exit_code
|
self.exit_code
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn not_found() -> Self {
|
||||||
|
Self { exit_code: 127 }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait Command {
|
pub trait Command {
|
||||||
|
@ -99,7 +103,7 @@ impl Command for UnixProgram {
|
||||||
} else {
|
} else {
|
||||||
let message = format!("{}: command not found", &program);
|
let message = format!("{}: command not found", &program);
|
||||||
error::print_error(message);
|
error::print_error(message);
|
||||||
ExitCode::new(127)
|
ExitCode::not_found()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue