Skip to main content

render_help

Function render_help 

Source
pub fn render_help(catalog: &[(String, Option<String>)]) -> String
Expand description

Render the unified command listing shown on help / unknown-command.

catalog is the merged (name, about) set — built-in subcommands plus every plugin-contributed command. Entries are sorted by name and deduplicated (first occurrence wins, so callers should place the built-ins first to let them win a name clash). Descriptions are padded into an aligned column; a command with no about shows a dash.

The output is a complete help screen (header, usage, command table, footer hint) ready to print to stdout (for help/--help) or stderr (after an error: unknown command line).