pub struct OptionSpec {
pub short_flags: Vec<String>,
pub long_flags: Vec<String>,
pub description: Option<String>,
pub option_type: OptionType,
pub required: bool,
pub default_value: Option<String>,
pub takes_argument: bool,
pub argument_name: Option<String>,
pub choices: Vec<String>,
}Expand description
Structured description of a single CLI option/flag.
Fields§
§short_flags: Vec<String>Short flags, e.g. [“-h”, “-v”]
long_flags: Vec<String>Long flags, e.g. [“–help”, “–verbose”]
description: Option<String>A brief description, if we could extract one.
option_type: OptionTypeType of the option (boolean, string, number, choice, path).
required: boolWhether the option is required.
default_value: Option<String>Default value, if any.
takes_argument: boolWhether the option takes an argument (true for --file <FILE>, false for --verbose).
argument_name: Option<String>Name of the argument, if takes_argument is true (e.g. "FILE", "PATH").
choices: Vec<String>For choice/enum options, the available choices.
Trait Implementations§
Source§impl Clone for OptionSpec
impl Clone for OptionSpec
Source§fn clone(&self) -> OptionSpec
fn clone(&self) -> OptionSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OptionSpec
impl Debug for OptionSpec
Source§impl<'de> Deserialize<'de> for OptionSpec
impl<'de> Deserialize<'de> for OptionSpec
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OptionSpec
impl RefUnwindSafe for OptionSpec
impl Send for OptionSpec
impl Sync for OptionSpec
impl Unpin for OptionSpec
impl UnwindSafe for OptionSpec
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
Mutably borrows from an owned value. Read more