pub struct CliHelpScreen {
    pub title: String,
    pub usage: String,
    pub description: String,
    pub params: IndexMap<String, String>,
    pub flags: IndexMap<String, String>,
    pub examples: Vec<String>,
}

Fields§

§title: String§usage: String§description: String§params: IndexMap<String, String>§flags: IndexMap<String, String>§examples: Vec<String>

Implementations§

source§

impl CliHelpScreen

source

pub fn new(title: &str, usage: &str, description: &str) -> Self

source

pub fn add_param(&mut self, param: &str, description: &str)

Add item to list of parameters that are displayed when the help screen is output.

source

pub fn add_flag(&mut self, flag: &str, description: &str)

Add item to list of flags that are displayed when the help screen is output.

source

pub fn add_example(&mut self, example: &str)

Add item to list of examples that are displayed when the help screen is output.

source

pub fn render( cmd: &Box<dyn CliCommand>, cmd_alias: &String, shortcuts: &Vec<String> )

via the command line is ‘help’ or ‘-h’. Outputs the help screen fo the specified CLI command.

source

pub fn render_index(router: &CliRouter)

Never needs to be manually executed, and is automatically when the first and only argument passed via command line is ‘help’ or ‘-h’. Displays either all availalbe categories or CLI commands depending whether or not categories have been added into the router.

source

pub fn render_category(router: &CliRouter, cat_alias: &String)

Never needs to be manually executed, and only applicable if you’re using multiple categories to organize groups of CLI commands. Executed first first argument via command line is either ‘help’ or ‘-h’, and second is the name of a category. Will display all CLI commands available within that category.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.