|
|
@ -1,5 +1,6 @@ |
|
|
|
use std::process::Command;
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub enum ShellError {
|
|
|
|
EmptyLine,
|
|
|
|
Exit,
|
|
|
@ -7,3 +8,15 @@ pub enum ShellError { |
|
|
|
ExecuteFailure(String),
|
|
|
|
MalformedArgs(String),
|
|
|
|
}
|
|
|
|
|
|
|
|
impl PartialEq<Self> for ShellError {
|
|
|
|
fn eq(&self, other: &Self) -> bool {
|
|
|
|
match self {
|
|
|
|
&ShellError::EmptyLine => matches!(other, ShellError::EmptyLine),
|
|
|
|
&ShellError::Exit => matches!(other, ShellError::Exit),
|
|
|
|
&ShellError::NotFound(_) => matches!(other, ShellError::NotFound(_)),
|
|
|
|
&ShellError::ExecuteFailure(_) => matches!(other, ShellError::ExecuteFailure(_)),
|
|
|
|
&ShellError::MalformedArgs(_) => matches!(other, ShellError::MalformedArgs(_)),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|