Skip to main content

HelpRenderer

Trait HelpRenderer 

Source
pub trait HelpRenderer: 'static {
    // Required methods
    fn app_help(&self, info: &AppInfo<'_>, long: bool) -> String;
    fn command_help(&self, app_name: &str, cmd: &Command, long: bool) -> String;
}
Expand description

A pluggable help renderer. Implement this and register it with crate::app::App::help_renderer to define a help look the built-in presets don’t cover. The library calls these to produce the final strings; it does no post-processing, so the renderer has full control.

Required Methods§

Source

fn app_help(&self, info: &AppInfo<'_>, long: bool) -> String

Render the top-level app help. long selects the expanded tier.

Source

fn command_help(&self, app_name: &str, cmd: &Command, long: bool) -> String

Render help for a single subcommand.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§