pub enum ArgSettings {
Show 18 variants Required, Multiple, EmptyValues, Global, Hidden, TakesValue, UseValueDelimiter, NextLineHelp, RequireDelimiter, HidePossibleValues, AllowLeadingHyphen, RequireEquals, Last, HideDefaultValue, CaseInsensitive, HideEnvValues, HiddenShortHelp, HiddenLongHelp, // some variants omitted
}
Expand description

Various settings that apply to arguments and may be set, unset, and checked via getter/setter methods Arg::set, Arg::unset, and Arg::is_set

Variants

Required

The argument must be used

Multiple

The argument may be used multiple times such as --flag --flag

EmptyValues

The argument allows empty values such as --option ""

Global

The argument should be propagated down through all child SubCommands

Hidden

The argument should not be shown in help text

TakesValue

The argument accepts a value, such as --option <value>

UseValueDelimiter

Determines if the argument allows values to be grouped via a delimiter

NextLineHelp

Prints the help text on the line after the argument

RequireDelimiter

Requires the use of a value delimiter for all multiple values

HidePossibleValues

Hides the possible values from the help string

AllowLeadingHyphen

Allows vals that start with a ‘-’

RequireEquals

Require options use --option=val syntax

Last

Specifies that the arg is the last positional argument and may be accessed early via -- syntax

HideDefaultValue

Hides the default value from the help string

CaseInsensitive

Makes Arg::possible_values case insensitive

HideEnvValues

Hides ENV values in the help message

HiddenShortHelp

The argument should not be shown in short help text

HiddenLongHelp

The argument should not be shown in long help text

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

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.