Struct falcon_cli::help::CliHelpScreen
source · 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
impl CliHelpScreen
pub fn new(title: &str, usage: &str, description: &str) -> Self
sourcepub fn add_param(&mut self, param: &str, description: &str)
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.
sourcepub fn add_flag(&mut self, flag: &str, description: &str)
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.
sourcepub fn add_example(&mut self, example: &str)
pub fn add_example(&mut self, example: &str)
Add item to list of examples that are displayed when the help screen is output.
sourcepub fn render(
cmd: &Box<dyn CliCommand>,
cmd_alias: &String,
shortcuts: &Vec<String>
)
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.
sourcepub fn render_index(router: &CliRouter)
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.
sourcepub fn render_category(router: &CliRouter, cat_alias: &String)
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.