[][src]Struct pflag::Flag

pub struct Flag<'a> {
    pub name: &'a str,
    pub shorthand: &'a str,
    pub usage: &'a str,
    pub value: Box<dyn Value>,
    pub def_value: &'a str,
    pub changed: bool,
    pub no_opt_def_value: &'a str,
    pub deprecated: &'a str,
    pub hidden: bool,
    pub shorthand_deprecated: &'a str,
}

A Flag represents the state of a flag.

Fields

name: &'a str

name as it appears on command line

shorthand: &'a str

one-letter abbreviated flag

usage: &'a str

help message

value: Box<dyn Value>

value as set

def_value: &'a str

default value (as text); for usage message

changed: bool

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

no_opt_def_value: &'a str

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

deprecated: &'a str

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: &'a str

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

Implementations

impl<'a> Flag<'a>[src]

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

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Flag<'a>

impl<'a> !Send for Flag<'a>

impl<'a> !Sync for Flag<'a>

impl<'a> Unpin for Flag<'a>

impl<'a> !UnwindSafe for Flag<'a>

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.