pub struct ArgMeta<'a> {Show 41 fields
pub arg: &'a Arg<'a>,
pub display_order: Option<u32>,
pub value_names: &'a [&'a str],
pub help: Option<&'a str>,
pub long_help: Option<&'a str>,
pub admonitions: &'a [AdmonitionMeta<'a>],
pub env: Option<&'a str>,
pub env_fallback: &'a [&'a str],
pub deprecated_env: &'a [&'a str],
pub default: &'a [&'a str],
pub accepted_choices: &'a [&'a str],
pub choices: &'a [&'a str],
pub choice_aliases: &'a [(&'a str, &'a str)],
pub choice_details: &'a [ChoiceMeta<'a>],
pub ignore_case: bool,
pub allow_unknown_choices: bool,
pub validate: Option<&'a str>,
pub validate_error: Option<&'a str>,
pub required: bool,
pub hide: bool,
pub hide_default_value: bool,
pub hide_env: bool,
pub hide_env_values: bool,
pub hide_possible_values: bool,
pub hide_short_help: bool,
pub hide_long_help: bool,
pub conflicts: &'a [&'a str],
pub requires: &'a [&'a str],
pub required_if: &'a [&'a str],
pub required_if_eq: &'a [RequiredIfEq<'a>],
pub required_if_eq_all: &'a [RequiredIfEq<'a>],
pub required_unless: &'a [&'a str],
pub required_unless_all: &'a [&'a str],
pub var_min: Option<u32>,
pub var_max: Option<u32>,
pub delimiter: Option<char>,
pub help_heading: Option<&'a str>,
pub surface: Option<&'a str>,
pub available_if: &'a [&'a str],
pub complete: Option<fn(&CompleteCtx<'_>) -> Vec<Candidate<'static>>>,
pub complete_type: Option<&'a str>,
}Expand description
What a positional argument knows about itself beyond how it parses.
Fields§
§arg: &'a Arg<'a>§display_order: Option<u32>Explicit placement within its help section.
value_names: &'a [&'a str]Ordered placeholders for a fixed-arity positional.
help: Option<&'a str>§long_help: Option<&'a str>§admonitions: &'a [AdmonitionMeta<'a>]Notes and warnings shown after the extended help text.
env: Option<&'a str>§env_fallback: &'a [&'a str]§deprecated_env: &'a [&'a str]§default: &'a [&'a str]§accepted_choices: &'a [&'a str]Canonical choices plus aliases accepted by the value type.
choices: &'a [&'a str]§choice_aliases: &'a [(&'a str, &'a str)]Canonical-to-alias pairs used when emitting a lossless spec.
choice_details: &'a [ChoiceMeta<'a>]Per-canonical presentation metadata used when emitting a lossless spec.
ignore_case: bool§allow_unknown_choices: boolAccept values outside choices while retaining the list for help and completion.
validate: Option<&'a str>Portable expr expression evaluated for each raw value.
validate_error: Option<&'a str>Message reported when validation returns false.
required: boolWhether the argument must be filled. The parser does not enforce this — it is checked once the last token has been read — but the spec has to say it, and help output has to show it.
hide: bool§hide_default_value: bool§hide_env: bool§hide_env_values: bool§hide_possible_values: bool§hide_short_help: bool§hide_long_help: bool§conflicts: &'a [&'a str]Entries that cannot be given alongside this positional.
requires: &'a [&'a str]§required_if: &'a [&'a str]§required_if_eq: &'a [RequiredIfEq<'a>]§required_if_eq_all: &'a [RequiredIfEq<'a>]§required_unless: &'a [&'a str]§required_unless_all: &'a [&'a str]§var_min: Option<u32>§var_max: Option<u32>§delimiter: Option<char>The character one word is split on to make several positional values.
help_heading: Option<&'a str>Heading to list this argument under in help output.
surface: Option<&'a str>Named audience or compatibility surface this argument belongs to.
available_if: &'a [&'a str]Descriptive availability conditions; they do not affect parsing.
complete: Option<fn(&CompleteCtx<'_>) -> Vec<Candidate<'static>>>What answers for this argument when a shell asks. See FlagMeta::complete.
complete_type: Option<&'a str>A built-in completion class such as path or dir.
Implementations§
Source§impl<'a> ArgMeta<'a>
Read access to every field, wherever it is stored.
impl<'a> ArgMeta<'a>
Read access to every field, wherever it is stored.
Prefer these to the fields: the fields are laid out for table size and may move behind
a cold extra half the way FlagMeta’s did in 6.11.1, and a getter keeps its name and
type when that happens.
pub const fn arg(&self) -> &'a Arg<'a>
Sourcepub const fn display_order(&self) -> Option<u32>
pub const fn display_order(&self) -> Option<u32>
Explicit placement within its help section.
Sourcepub const fn value_names(&self) -> &'a [&'a str]
pub const fn value_names(&self) -> &'a [&'a str]
Ordered placeholders for a fixed-arity positional.
pub const fn help(&self) -> Option<&'a str>
pub const fn long_help(&self) -> Option<&'a str>
Sourcepub const fn admonitions(&self) -> &'a [AdmonitionMeta<'a>]
pub const fn admonitions(&self) -> &'a [AdmonitionMeta<'a>]
Notes and warnings shown after the extended help text.
pub const fn env(&self) -> Option<&'a str>
pub const fn env_fallback(&self) -> &'a [&'a str]
pub const fn deprecated_env(&self) -> &'a [&'a str]
pub const fn default(&self) -> &'a [&'a str]
Sourcepub const fn accepted_choices(&self) -> &'a [&'a str]
pub const fn accepted_choices(&self) -> &'a [&'a str]
Canonical choices plus aliases accepted by the value type.
pub const fn choices(&self) -> &'a [&'a str]
Sourcepub const fn choice_aliases(&self) -> &'a [(&'a str, &'a str)]
pub const fn choice_aliases(&self) -> &'a [(&'a str, &'a str)]
Canonical-to-alias pairs used when emitting a lossless spec.
Sourcepub const fn choice_details(&self) -> &'a [ChoiceMeta<'a>]
pub const fn choice_details(&self) -> &'a [ChoiceMeta<'a>]
Per-canonical presentation metadata used when emitting a lossless spec.
pub const fn ignore_case(&self) -> bool
Sourcepub const fn allow_unknown_choices(&self) -> bool
pub const fn allow_unknown_choices(&self) -> bool
Accept values outside choices while retaining the list for help and completion.
Sourcepub const fn validate(&self) -> Option<&'a str>
pub const fn validate(&self) -> Option<&'a str>
Portable expr expression evaluated for each raw value.
Sourcepub const fn validate_error(&self) -> Option<&'a str>
pub const fn validate_error(&self) -> Option<&'a str>
Message reported when validation returns false.
Sourcepub const fn required(&self) -> bool
pub const fn required(&self) -> bool
Whether the argument must be filled. The parser does not enforce this — it is checked once the last token has been read — but the spec has to say it, and help output has to show it.
pub const fn hide(&self) -> bool
pub const fn hide_default_value(&self) -> bool
pub const fn hide_env(&self) -> bool
pub const fn hide_env_values(&self) -> bool
pub const fn hide_possible_values(&self) -> bool
pub const fn hide_short_help(&self) -> bool
pub const fn hide_long_help(&self) -> bool
Sourcepub const fn conflicts(&self) -> &'a [&'a str]
pub const fn conflicts(&self) -> &'a [&'a str]
Entries that cannot be given alongside this positional.
pub const fn requires(&self) -> &'a [&'a str]
pub const fn required_if(&self) -> &'a [&'a str]
pub const fn required_if_eq(&self) -> &'a [RequiredIfEq<'a>]
pub const fn required_if_eq_all(&self) -> &'a [RequiredIfEq<'a>]
pub const fn required_unless(&self) -> &'a [&'a str]
pub const fn required_unless_all(&self) -> &'a [&'a str]
pub const fn var_min(&self) -> Option<u32>
pub const fn var_max(&self) -> Option<u32>
Sourcepub const fn delimiter(&self) -> Option<char>
pub const fn delimiter(&self) -> Option<char>
The character one word is split on to make several positional values.
Sourcepub const fn help_heading(&self) -> Option<&'a str>
pub const fn help_heading(&self) -> Option<&'a str>
Heading to list this argument under in help output.
Sourcepub const fn surface(&self) -> Option<&'a str>
pub const fn surface(&self) -> Option<&'a str>
Named audience or compatibility surface this argument belongs to.
Sourcepub const fn available_if(&self) -> &'a [&'a str]
pub const fn available_if(&self) -> &'a [&'a str]
Descriptive availability conditions; they do not affect parsing.
Sourcepub const fn complete(
&self,
) -> Option<fn(&CompleteCtx<'_>) -> Vec<Candidate<'static>>>
pub const fn complete( &self, ) -> Option<fn(&CompleteCtx<'_>) -> Vec<Candidate<'static>>>
What answers for this argument when a shell asks. See FlagMeta::complete.
Sourcepub const fn complete_type(&self) -> Option<&'a str>
pub const fn complete_type(&self) -> Option<&'a str>
A built-in completion class such as path or dir.