id | Set the identifier used for referencing this argument in the clap API. |
short | Sets the short version of the argument without the preceding - . |
long | Sets the long version of the argument without the preceding -- . |
alias | Add an alias, which functions as a hidden long flag. |
short_alias | Add an alias, which functions as a hidden short flag. |
aliases | Add aliases, which function as hidden long flags. |
short_aliases | Add aliases, which functions as a hidden short flag. |
visible_alias | Add an alias, which functions as a visible long flag. |
visible_short_alias | Add an alias, which functions as a visible short flag. |
visible_aliases | Add aliases, which function as visible long flags. |
visible_short_aliases | Add aliases, which function as visible short flags. |
index | Specifies the index of a positional argument starting at 1. |
trailing_var_arg | This is a “var arg” and everything that follows should be captured by it, as if the user had used a -- . |
last | This arg is the last, or final, positional argument (i.e. has the highest index) and is only able to be accessed via the -- syntax (i.e. $ prog args -- last_arg ). |
required | Specifies that the argument must be present. |
requires | Sets an argument that is required when this one is present. |
exclusive | This argument must be passed alone; it conflicts with all other arguments. |
global | Specifies that an argument can be matched to all child Subcommands. |
action | Specify how to react to an argument when parsing it. |
value_parser | Specify the typed behavior of the argument. |
num_args | Specifies the number of arguments parsed per occurrence. |
value_name | Placeholder for the argument’s value in the help message / usage. |
value_names | Placeholders for the argument’s values in the help message / usage. |
value_hint | Provide the shell a hint about how to complete this argument. |
ignore_case | Match values against PossibleValuesParser without matching case. |
allow_hyphen_values | Allows values which start with a leading hyphen (- ) |
allow_negative_numbers | Allows negative numbers to pass as values. |
require_equals | Requires that options use the --option=val syntax |
value_delimiter | Allow grouping of multiple values via a delimiter. |
value_terminator | Sentinel to stop parsing multiple values of a given argument. |
raw | Consume all following arguments. |
default_value | Value for the argument when not present. |
default_values | Value for the argument when not present. |
default_missing_value | Value for the argument when the flag is present but no value is specified. |
default_missing_value_os | Value for the argument when the flag is present but no value is specified. |
default_missing_values | Value for the argument when the flag is present but no value is specified. |
default_missing_values_os | Value for the argument when the flag is present but no value is specified. |
env | Read from name environment variable when argument is not present. |
help | Sets the description of the argument for short help (-h ). |
long_help | Sets the description of the argument for long help (--help ). |
display_order | Allows custom ordering of args within the help message. |
help_heading | Override the current help section. |
next_line_help | Render the help on the line after the argument. |
hide | Hide this argument from the generated help text. |
hide_possible_values | Do not display the possible values in the help message. |
hide_default_value | Do not display the default value of the argument in the help message. |
hide_env | Do not display in help the environment variable name. |
hide_env_values | Do not display in help any values inside the associated ENV variables for the argument. |
hide_short_help | Hides an argument from short help (-h ). |
hide_long_help | Hides an argument from long help (--help ). |
group | The name of the ArgGroup the argument belongs to. |
groups | The names of ArgGroup’s the argument belongs to. |
default_value_if | Specifies the value of the argument if arg has been used at runtime. |
default_value_ifs | Specifies multiple values and conditions in the same manner as default_value_if . |
required_unless_present | Set this arg as required as long as the specified argument is not present at runtime. |
required_unless_present_all | Sets this arg as required unless all of the specified arguments are present at runtime. |
required_unless_present_any | Sets this arg as required unless any of the specified arguments are present at runtime. |
required_if_eq | This argument is required only if the specified arg is present at runtime and its value equals val. |
required_if_eq_any | Specify this argument is required based on multiple conditions. |
required_if_eq_all | Specify this argument is required based on multiple conditions. |
requires_if | Require another argument if this arg matches the ArgPredicate. |
requires_ifs | Allows multiple conditional requirements. |
conflicts_with | This argument is mutually exclusive with the specified argument. |
conflicts_with_all | This argument is mutually exclusive with the specified arguments. |
overrides_with | Sets an overridable argument. |
overrides_with_all | Sets multiple mutually overridable arguments by name. |