pub struct OptionDef {
pub long: String,
pub short: Option<char>,
pub placeholder: String,
pub description: String,
pub required: bool,
pub default: Option<String>,
pub env_var: Option<String>,
pub multi: bool,
pub hidden: bool,
}Expand description
Definition of a key-value option (e.g. --output FILE / -o FILE).
Fields§
§long: StringLong name used as --name.
short: Option<char>Optional single-character short form used as -c.
placeholder: StringPlaceholder shown in help text (e.g. FILE, NUM).
description: StringHuman-readable description shown in help text.
required: boolWhen true, parsing fails if this option is not provided.
default: Option<String>Default value used when the option is absent from CLI and env.
env_var: Option<String>Environment variable name to check as a fallback.
multi: boolWhen true, repeated occurrences are collected into a Vec.
When true, this option is omitted from help text but still parsed.
Trait Implementations§
impl Eq for OptionDef
impl StructuralPartialEq for OptionDef
Auto Trait Implementations§
impl Freeze for OptionDef
impl RefUnwindSafe for OptionDef
impl Send for OptionDef
impl Sync for OptionDef
impl Unpin for OptionDef
impl UnsafeUnpin for OptionDef
impl UnwindSafe for OptionDef
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