|
|
@ -12,7 +12,7 @@ pub enum ParseErrorKind
|
|
|
|
ExpectedArg(String),
|
|
|
|
ExpectedArg(String),
|
|
|
|
UnexpectedArg(Option<String>),
|
|
|
|
UnexpectedArg(Option<String>),
|
|
|
|
UnknownOption(char),
|
|
|
|
UnknownOption(char),
|
|
|
|
UnknownKeyFormat(&'static str),
|
|
|
|
UnknownKeyFormat(&'static str, String),
|
|
|
|
UnknownOptionFor(char, char),
|
|
|
|
UnknownOptionFor(char, char),
|
|
|
|
CannotCombine(char, char),
|
|
|
|
CannotCombine(char, char),
|
|
|
|
BadTail(char, String),
|
|
|
|
BadTail(char, String),
|
|
|
@ -32,7 +32,7 @@ impl fmt::Display for ParseErrorKind
|
|
|
|
Self::UnexpectedArg(None) => write!(f, "unknown argument"),
|
|
|
|
Self::UnexpectedArg(None) => write!(f, "unknown argument"),
|
|
|
|
Self::UnexpectedArg(Some(arg)) => write!(f, "argument {:?} not expected here", arg),
|
|
|
|
Self::UnexpectedArg(Some(arg)) => write!(f, "argument {:?} not expected here", arg),
|
|
|
|
Self::UnknownOption(ch) => write!(f, "unknown option `{}`", ch),
|
|
|
|
Self::UnknownOption(ch) => write!(f, "unknown option `{}`", ch),
|
|
|
|
Self::UnknownKeyFormat(key) => write!(f, "unknown key format for {}", key),
|
|
|
|
Self::UnknownKeyFormat(key, fmt) => write!(f, "unknown key format {:?} for {}", fmt, key),
|
|
|
|
Self::UnknownOptionFor(fo, o) => write!(f, "unknown option `{}` for `{}`", o, fo),
|
|
|
|
Self::UnknownOptionFor(fo, o) => write!(f, "unknown option `{}` for `{}`", o, fo),
|
|
|
|
Self::CannotCombine(o1,o2) => write!(f, "cannot combine option `{}` with `{}`", o2, o1),
|
|
|
|
Self::CannotCombine(o1,o2) => write!(f, "cannot combine option `{}` with `{}`", o2, o1),
|
|
|
|
Self::BadTail(ch, ret) => write!(f, "unexpected tail {:?} for option `{}`", ret, ch),
|
|
|
|
Self::BadTail(ch, ret) => write!(f, "unexpected tail {:?} for option `{}`", ret, ch),
|
|
|
|