[−][src]Struct climake::CliMake
Main holder structure of entire climake library, used to create new CLIs.
It is reccomended this be called something simple like cli
for ease of use
as this is the most used part of climake.
Example initiation
ⓘThis example is not tested
let cli = CliMake.new( vec![first_arg, other_arg], Some("This is some help info for this example CLI.") );
Fields
arguments: Vec<CliArgument>
Arguments that this library parses.
help_str: &'static str
Help message that user sees on a --help
request or if nothing is
passed/bad arguments passed.
Example output
The A simple CLI.
in the following terminal output:
Usage: ./readme_showcase [OPTIONS]
About:
This is some help info for this example CLI.
Options:
[-q, --qwerty] - Some useful help info.
[-o, -t, --other] - No extra CLI help provided.
Implementations
impl CliMake
[src]
pub fn new(
arguments: Vec<CliArgument>,
help: Option<&'static str>
) -> Result<Self, CliError>
[src]
arguments: Vec<CliArgument>,
help: Option<&'static str>
) -> Result<Self, CliError>
Creates a new CliMake from arguments and optional help.
pub fn parse(&self)
[src]
Parses arguments from command line and automatically runs the closures optionally given for CliArgument or displays help infomation.
pub fn add_arg(&mut self, argument: CliArgument) -> Result<(), CliError>
[src]
Adds new argument to CliMake
pub fn help_msg(&self) -> String
[src]
Returns parsed help message as a String.
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]
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, 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>,