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

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