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.

MissingMandatoryPositional(String)

The command specified a mandatory positional argument, but it was missing.

MissingValueForName(String)

A flag was found, and it should have been followed by a value, but no value was found

UnexpectedArgument(Spanned<String>)

An argument was found, but the command does not recognize it

UnexpectedFlag(Spanned<String>)

An flag was found, but the command does not recognize it

InvalidExternalWord

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. 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

This method tests greater than or equal to (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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

Converts a value into a Spanned value

Converts a value into a Spanned value, using an unknown Span

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.