pub struct FlagSnapshot {Show 16 fields
pub short: Option<char>,
pub long: Option<String>,
pub value_name: Option<String>,
pub value_kind: ValueKind,
pub choices: Vec<String>,
pub repeatable: bool,
pub required: bool,
pub negatable: bool,
pub hidden: bool,
pub deprecated: Option<String>,
pub inherited: bool,
pub group: Option<String>,
pub description: Option<String>,
pub default: Option<String>,
pub env_var: Option<String>,
pub provenance: ProvenanceSnapshot,
}Expand description
Snapshot form of Flag. Field order matches Flag’s own declaration;
every Option/Vec field is omitted when empty, every bool field is
omitted when false.
Fields§
§short: Option<char>Short spelling, e.g. 'i' for -i.
long: Option<String>Long spelling, e.g. "interactive" for --interactive.
value_name: Option<String>The value placeholder, e.g. "FILE" in --output FILE.
value_kind: ValueKindWhether this flag takes no value, a required value, or an optional one. Omitted for the common no-value case.
choices: Vec<String>Enumerated choices, e.g. {json|yaml|table} for --format.
repeatable: boolTrue if this flag may be given more than once.
required: boolTrue if this flag is required.
negatable: boolTrue if the tool documents this boolean’s negation inline
(--[no-]foo). long holds the base name either way.
True if this flag should be hidden by default.
deprecated: Option<String>The deprecation reason, when deprecated.
inherited: boolTrue when inherited from an ancestor node.
group: Option<String>Display grouping from the source, e.g. tar’s “Main operation mode”.
description: Option<String>The flag’s description.
default: Option<String>The flag’s default value, if documented.
env_var: Option<String>An environment variable that also sets this flag, if documented.
provenance: ProvenanceSnapshotWhich source(s) contributed this flag’s fields.
Trait Implementations§
Source§impl Clone for FlagSnapshot
impl Clone for FlagSnapshot
Source§fn clone(&self) -> FlagSnapshot
fn clone(&self) -> FlagSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more