You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
720 B
22 lines
720 B
use std::process::Command;
|
|
|
|
#[derive(Debug)]
|
|
pub enum ShellError {
|
|
EmptyLine,
|
|
NotFound(Command),
|
|
ExecuteFailure(String),
|
|
MalformedArgs(String),
|
|
Interrupt,
|
|
}
|
|
|
|
impl PartialEq<Self> for ShellError {
|
|
fn eq(&self, other: &Self) -> bool {
|
|
match self {
|
|
&ShellError::EmptyLine => matches!(other, ShellError::EmptyLine),
|
|
&ShellError::NotFound(_) => matches!(other, ShellError::NotFound(_)),
|
|
&ShellError::ExecuteFailure(_) => matches!(other, ShellError::ExecuteFailure(_)),
|
|
&ShellError::MalformedArgs(_) => matches!(other, ShellError::MalformedArgs(_)),
|
|
&ShellError::Interrupt => matches!(other, ShellError::Interrupt),
|
|
}
|
|
}
|
|
}
|