pub struct FlagDescriptor {
pub name: &'static str,
pub flag_type: FlagType,
pub required: bool,
pub default: Option<&'static str>,
pub description: &'static str,
pub repeatable: bool,
pub short: Option<char>,
}Expand description
Descriptor for a single provider-specific flag.
Designed so that obz can convert it to a clap::Arg without any
additional information. All fields that clap needs are present here.
Fields§
§name: &'static strLong flag name without the -- prefix (e.g. "round-digits").
Must be unique within a command across all providers sharing that command.
flag_type: FlagTypeValue type — determines the clap value_parser and ArgAction.
required: boolWhether the flag is required for this provider.
Always declare false at the clap level — enforcement happens at
runtime after the provider is resolved, so other providers that
don’t use this flag don’t get a clap error.
default: Option<&'static str>Default value as a string. None means no default.
description: &'static strShort one-line help text shown in --help.
repeatable: boolWhether the flag may be specified multiple times.
short: Option<char>Optional single-character short flag (e.g. Some('q') for -q).
Trait Implementations§
Source§impl Clone for FlagDescriptor
impl Clone for FlagDescriptor
Source§fn clone(&self) -> FlagDescriptor
fn clone(&self) -> FlagDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more