use std::fmt::{self, Display};
#[derive(Clone, Debug)]
pub enum Error {
MissingArgument(String),
MissingValue(String),
}
impl Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::MissingArgument(key) => {
write!(f, "argument '{}' is required", key)
}
Error::MissingValue(key) => {
write!(f, "argument '{}' requires a value", key)
}
}
}
}
impl std::error::Error for Error {}
pub type Result<T> = std::result::Result<T, Error>;