[][src]Struct climake::CLIMake

pub struct CLIMake {
    pub name: String,
    pub description: Option<String>,
    pub args: Vec<Argument>,
    pub none_run: Option<Box<dyn Fn()>>,
}

Main structure for climake, the CLIMake object. Further arguments can easily be added using CLIMake::add_existing_arg.

Fields

name: String

Name of overall CLI

description: Option<String>

Description of CLI (if any)

args: Vec<Argument>

Arguments included

none_run: Option<Box<dyn Fn()>>

An optional run parameter if no arguments are passed. If this is Option::None and no arguments are passed, climake will default to CLIMakeError::NoArgumentsPassed.

Methods

impl CLIMake[src]

pub fn parse_args(&mut self)[src]

Parses arguments given from the avalible CLIMake::args and runs the corrosponding tasks in order.

NOTE: This function will eventually close the program running using std::process.

pub fn add_existing_arg(
    &mut self,
    new_arg: Argument
) -> Result<(), CLIMakeError>
[src]

Adds a new argument to parser.

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

Displays help message in stdout using added arguments.

Auto Trait Implementations

impl !RefUnwindSafe for CLIMake

impl !Send for CLIMake

impl !Sync for CLIMake

impl Unpin for CLIMake

impl !UnwindSafe for CLIMake

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.