use thiserror::Error; #[derive(Error, Debug)] pub enum ParseError { #[error("no action given")] MissingAction, #[error("unknown action: {action}")] UnknownAction { action: String }, #[error("unexpected input: {rest:?}")] UnexpectedInput { rest: Vec }, } pub trait CliCommand { type ExecErr: From; fn parse_str(input: &str, rest: impl Iterator) -> Result where Self: Sized; }