pub(crate) enum Message {
Show 17 variants
NoEnv(&'static str),
ParseSome(&'static str),
ParseFail(&'static str),
PureFailed(String),
Missing(Vec<MissingItem>),
ParseFailure(ParseFailure),
StrictPos(usize, Metavar),
NonStrictPos(usize, Metavar),
ParseFailed(Option<usize>, String),
GuardFailed(Option<usize>, &'static str),
NoArgument(usize, Metavar),
Unconsumed(usize),
Ambiguity(usize, String),
Suggestion(usize, Suggestion),
Conflict(usize, usize),
Expected(Vec<Item>, Option<usize>),
OnlyOnce(usize, usize),
}Variants§
NoEnv(&'static str)
Tried to consume an env variable with no fallback, variable was not set
ParseSome(&'static str)
User specified an error message on some
ParseFail(&'static str)
User asked for parser to fail explicitly
PureFailed(String)
pure_with failed to parse a value
Missing(Vec<MissingItem>)
Expected one of those values
Used internally to generate better error messages
ParseFailure(ParseFailure)
Parsing failed and this is the final output
StrictPos(usize, Metavar)
Tried to consume a strict positional argument, value was present but was not strictly positional
NonStrictPos(usize, Metavar)
Tried to consume a non-strict positional argument, but the value was strict
ParseFailed(Option<usize>, String)
Parser provided by user failed to parse a value
GuardFailed(Option<usize>, &'static str)
Parser provided by user failed to validate a value
NoArgument(usize, Metavar)
Argument requres a value but something else was passed,
required: –foo
Unconsumed(usize)
Parser is expected to consume all the things from the command line this item will contain an index of the unconsumed value
Ambiguity(usize, String)
argument is ambigoups - parser can accept it as both a set of flags and a short flag with no =
Suggestion(usize, Suggestion)
Suggested fixes for typos or missing input
Conflict(usize, usize)
Two arguments are mutually exclusive –release –dev
Expected(Vec<Item>, Option<usize>)
Expected one or more items in the scope, got someting else if any
OnlyOnce(usize, usize)
Parameter is accepted but only once