[][src]Struct climake::Argument

pub struct Argument {
    pub short_call: Option<char>,
    pub standalone_call: Option<String>,
    pub got_param: bool,
    pub help: Option<String>,
    pub run: Box<dyn Fn(Option<String>)>,
}

A single argument used inside of [CLIMaker].

Fields

short_call: Option<char>

A short call parameter that is used with a prefix of a single hyphen (-).

standalone_call: Option<String>

A long call parameter. This allows a user to enter something like ./test hello instead of ./test --hello.

got_param: bool

Allows it to capture next element inside of arguments. This is experimental and can be buggy if you do something like hello hello that will go on forever.

help: Option<String>

Help message (highly reccomended).

run: Box<dyn Fn(Option<String>)>

Item to run when asked to execute, this should be the main usage of the argument. The Option<String> is linked to Argument::got_param. If got_param is true, there will always be String present, even if inside of an Option.

Auto Trait Implementations

impl !RefUnwindSafe for Argument

impl !Send for Argument

impl !Sync for Argument

impl Unpin for Argument

impl !UnwindSafe for Argument

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.