[−][src]Struct seahorse::Flag
Flag
type.
Option flag struct
Fields
name: String
Flag name
usage: String
Flag usage
flag_type: FlagType
Flag type
alias: Option<Vec<String>>
Flag alias
Methods
impl Flag
[src]
pub fn new<T: Into<String>>(name: T, usage: T, flag_type: FlagType) -> Self
[src]
Create new instance of Flag
Example
use seahorse::{Flag, FlagType}; let bool_flag = Flag::new("bool", "cli cmd [arg] --bool", FlagType::Bool); let float_flag = Flag::new("float", "cli cmd [arg] --float [float]", FlagType::Float);
pub fn alias<T: Into<String>>(self, name: T) -> Self
[src]
Set alias of the flag
Example
use seahorse::{Flag, FlagType}; let bool_flag = Flag::new("bool", "cli cmd [arg] --bool", FlagType::Bool) .alias("b"); let string_flag = Flag::new("string", "cli cmd [arg] --string [string]", FlagType::String) .alias("s") .alias("str");
pub fn value(&self, v: &Vec<String>) -> Option<FlagValue>
[src]
Get flag value
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,