pub enum ParseError {
Show 13 variants
MissingRequired(String),
MissingValue(String),
UnknownArgument(String),
InvalidFormat(String),
HelpRequested(String),
VersionRequested(String),
NoSubcommand(String),
UnknownSubcommand(String),
DuplicateOption(String),
InvalidUtf8(String),
ValidationFailed {
name: String,
message: String,
},
GroupViolation {
group: String,
members: Vec<String>,
},
ConflictViolation {
conflict: String,
provided: Vec<String>,
},
}Expand description
Errors produced during argument parsing.
The HelpRequested and VersionRequested variants carry the formatted
text that should be printed to stdout. All other variants represent actual
errors and carry a descriptive message suitable for display.
Implements std::fmt::Display and std::error::Error. When the
color feature is enabled, the Display output includes ANSI styling.
Variants§
MissingRequired(String)
A required argument was not provided. Contains the argument name.
MissingValue(String)
An option was provided without a value. Contains the option name.
UnknownArgument(String)
An unrecognized argument was encountered. Contains the raw token.
InvalidFormat(String)
A structural error in the parser definition. Contains a description.
HelpRequested(String)
The -h / --help flag was encountered. Contains the formatted help text.
VersionRequested(String)
The -V / --version flag was encountered. Contains the formatted version text.
NoSubcommand(String)
A subcommand was expected but none was provided. Contains available names.
UnknownSubcommand(String)
An unrecognized subcommand was provided. Contains the unknown name.
DuplicateOption(String)
A non-multi option was provided more than once. Contains the option name.
InvalidUtf8(String)
A command-line argument contained bytes that are not valid UTF-8. Contains the lossy representation.
ValidationFailed
A value failed validation. Contains the argument name and error message.
Fields
GroupViolation
An argument group constraint was violated: none of the members were provided.
Fields
ConflictViolation
A conflict set constraint was violated: two or more mutually exclusive members were provided.
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more