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.

20 lines
627 B

  1. use std::process::Command;
  2. #[derive(Debug)]
  3. pub enum ShellError {
  4. EmptyLine,
  5. NotFound(Command),
  6. ExecuteFailure(String),
  7. MalformedArgs(String),
  8. }
  9. impl PartialEq<Self> for ShellError {
  10. fn eq(&self, other: &Self) -> bool {
  11. match self {
  12. &ShellError::EmptyLine => matches!(other, ShellError::EmptyLine),
  13. &ShellError::NotFound(_) => matches!(other, ShellError::NotFound(_)),
  14. &ShellError::ExecuteFailure(_) => matches!(other, ShellError::ExecuteFailure(_)),
  15. &ShellError::MalformedArgs(_) => matches!(other, ShellError::MalformedArgs(_)),
  16. }
  17. }
  18. }