[][src]Struct climake::CliArgument

pub struct CliArgument {
    pub help_str: &'static str,
    // some fields omitted
}

A single argument in a list of arguments to parse later in CliMake::parse.

Example inititation

This example is not tested
let arg_onetwo = CliArgument.new(
    vec!['o', 't'],
    vec!["onetwo"],
    Some("This is some detailed help for onetwo"),
    Box::new(&to_run_for_onetwo)
);

Fields

help_str: &'static str

Inner-command help for a specific argument. See CliArgument::help_msg for a better help representation.

Implementations

impl CliArgument[src]

pub fn new(
    short_calls: Vec<char>,
    long_calls: Vec<&'static str>,
    help: Option<&'static str>,
    run: Box<dyn FnMut(Vec<String>)>
) -> Self
[src]

Creates a new argument in a simplistic manner.

pub fn help_msg(&self) -> String[src]

Gives in-depth details and running infomation compared to the plaintext CliArgument::help_str, reccomended to use.

Example results

Both below are taken from the dynamic args example:

Usage: ./dynamic_args [-q, -r, -s, --hi, --second] [CONTENT]

About:
  Simple help
Usage: ./dynamic_args [-a, -b, -c, --other, --thing] [CONTENT]

About:
  Other help

Auto Trait Implementations

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.