[][src]Struct pflag::Flag

pub struct Flag {
    pub name: String,
    pub shorthand: char,
    pub usage: String,
    pub value: Box<dyn Value>,
    pub def_value: String,
    pub changed: bool,
    pub no_opt_def_value: String,
    pub deprecated: String,
    pub hidden: bool,
    pub shorthand_deprecated: String,
}

A Flag represents the state of a flag.

Fields

name: String

name as it appears on command line

shorthand: char

one-letter abbreviated flag

usage: String

help message

value: Box<dyn Value>

value as set

def_value: String

default value (as text); for usage message

changed: bool

If the user set the value (or if left to default)

no_opt_def_value: String

default value (as text); if the flag is on the command line without any options

deprecated: String

If this flag is deprecated, this string is the new or now thing to use

hidden: bool

used by cobra.Command to allow flags to be hidden from help/usage text

shorthand_deprecated: String

If the shorthand of this flag is deprecated, this string is the new or now thing to use

Implementations

impl Flag[src]

pub fn set(&mut self, val: String) -> Result<(), ValueError>[src]

Auto Trait Implementations

impl !RefUnwindSafe for Flag

impl !Send for Flag

impl !Sync for Flag

impl Unpin for Flag

impl !UnwindSafe for Flag

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.