Enum nu_errors::ArgumentError [−][src]
pub enum ArgumentError {
MissingMandatoryFlag(String),
MissingMandatoryPositional(String),
MissingValueForName(String),
UnexpectedArgument(Spanned<String>),
UnexpectedFlag(Spanned<String>),
InvalidExternalWord,
BadValue(String),
}
Expand description
ArgumentError describes various ways that the parser could fail because of unexpected arguments. Nu commands are like a combination of functions and macros, and these errors correspond to problems that could be identified during expansion based on the syntactic signature of a command.
Variants
MissingMandatoryFlag(String)
The command specified a mandatory flag, but it was missing.
Tuple Fields of MissingMandatoryFlag
0: String
MissingMandatoryPositional(String)
The command specified a mandatory positional argument, but it was missing.
Tuple Fields of MissingMandatoryPositional
0: String
MissingValueForName(String)
A flag was found, and it should have been followed by a value, but no value was found
Tuple Fields of MissingValueForName
0: String
An argument was found, but the command does not recognize it
An flag was found, but the command does not recognize it
A sequence of characters was found that was not syntactically valid (but would have been valid if the command was an external command)
BadValue(String)
A bad value in this location
Tuple Fields of BadValue
0: String
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
A convenience method that prints out the document without colors in 70 columns. Generally, you should use plain_string or colored_string if possible, but display() can be useful for trace lines and things like that, where you don’t have control over the terminal. Read more
Auto Trait Implementations
impl RefUnwindSafe for ArgumentError
impl Send for ArgumentError
impl Sync for ArgumentError
impl Unpin for ArgumentError
impl UnwindSafe for ArgumentError
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.