pub struct ArgSpec {Show 16 fields
pub id: String,
pub long: Option<String>,
pub short: Option<char>,
pub help: Option<String>,
pub long_help: Option<String>,
pub required: bool,
pub default_values: Vec<String>,
pub possible_values: Vec<String>,
pub value_enum: bool,
pub num_args_min: usize,
pub num_args_max: Option<usize>,
pub global: bool,
pub hidden: bool,
pub positional: bool,
pub index: Option<usize>,
pub action: String,
}Expand description
A single CLI argument/flag.
Fields§
§id: StringClap argument id (stable identifier used for conflict groups, etc.).
long: Option<String>Long flag name without leading --.
short: Option<char>Short flag letter (without leading -).
help: Option<String>Help text shown in --help.
long_help: Option<String>Long help text shown in --help.
required: boolWhether the argument is required.
default_values: Vec<String>Default values (as shown by clap and used when the argument is absent).
This is always present; an empty list means there is no configured default.
possible_values: Vec<String>Enumerated possible values for the argument value parser (if known).
This is always present; an empty list means clap does not advertise a finite set of possible values for this argument.
value_enum: boolWhether the argument’s value is parsed as a clap ValueEnum type.
This is intended for tooling (e.g., rendering dropdowns) and is a best-effort reflection of the clap configuration.
num_args_min: usizeMinimum number of values this argument accepts per occurrence.
num_args_max: Option<usize>Maximum number of values this argument accepts per occurrence (inclusive).
None means unbounded.
global: boolWhether the argument is global (propagates to subcommands).
Whether the argument is hidden from normal help output.
positional: boolWhether the argument is positional.
index: Option<usize>For positional arguments, the 1-based index.
action: StringThe clap action driving how values are applied (e.g. Set, SetTrue, Append).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ArgSpec
impl<'de> Deserialize<'de> for ArgSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ArgSpec
impl JsonSchema for ArgSpec
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl Eq for ArgSpec
impl StructuralPartialEq for ArgSpec
Auto Trait Implementations§
impl Freeze for ArgSpec
impl RefUnwindSafe for ArgSpec
impl Send for ArgSpec
impl Sync for ArgSpec
impl Unpin for ArgSpec
impl UnsafeUnpin for ArgSpec
impl UnwindSafe for ArgSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.