pub struct Item {Show 25 fields
pub short: Option<char>,
pub long: Option<&'static str>,
pub aliases: &'static [&'static str],
pub negate: Option<&'static str>,
pub value_name: Option<&'static str>,
pub help: &'static str,
pub long_help: &'static str,
pub heading: Option<&'static str>,
pub hide: bool,
pub positional: bool,
pub required: bool,
pub multiple: bool,
pub trailing: bool,
pub default: Option<&'static str>,
pub env: Option<&'static str>,
pub choices: &'static [&'static str],
pub require_equals: bool,
pub global: bool,
pub more_shorts: &'static [char],
pub plus: Option<char>,
pub optional_value: bool,
pub values: usize,
pub more_values: bool,
pub hint: Hint,
pub complete: Option<fn(&str) -> Vec<Candidate>>,
}Expand description
A flag or positional.
Fields§
§short: Option<char>-c.
long: Option<&'static str>--name.
aliases: &'static [&'static str]Other long names it answers to, not shown.
negate: Option<&'static str>--no-name, the spelling that sets it false.
value_name: Option<&'static str>The value’s placeholder; None for a switch.
help: &'static strFirst paragraph of the description.
long_help: &'static strThe whole description.
heading: Option<&'static str>Section to list it under instead of “Options”.
hide: boolLeft out of help.
positional: boolA positional rather than a flag.
required: boolMust be given.
multiple: boolTakes several values or occurrences.
trailing: boolA positional that only takes words after --.
default: Option<&'static str>The value used when none is given.
env: Option<&'static str>The environment variable consulted.
choices: &'static [&'static str]The only values accepted.
require_equals: boolThe value is only taken attached (--name=value), never the next word.
global: boolAlso accepted by every subcommand below.
more_shorts: &'static [char]Other letters it answers to: -l, -L.
plus: Option<char>The letter of its +c spelling.
optional_value: boolThe value may be left out.
values: usizeWords each occurrence takes; 1 unless declared values = N.
more_values: boolIt may take more than values (values = 1..): shown as <V>....
hint: HintWhat its value is, for the shell that completes it.
complete: Option<fn(&str) -> Vec<Candidate>>What its value can be, given what is typed of it: asked when a shell completes it, in place of its choices and its hint.