Skip to main content

render_runtime_help

Function render_runtime_help 

Source
pub fn render_runtime_help(
    spec: &Spec,
    cmd: &SpecCommand,
    long: bool,
    style: Style,
    env: Option<&HashMap<String, String>>,
) -> String
Expand description

Render the help page of a program that is running, listing what choices run= prints.

The page render_help_styled draws, except that each choices run= command on it is run and its output listed among the possible values, as choices "a" "b" would be. A command that fails is described instead, the way the static page describes it, and what it wrote to stderr reaches the terminal. env is added to each command’s environment, for a caller that parses with crate::Parser::with_env. Each distinct command runs once per page.

For a script’s or task’s --help; generated documentation should use render_help_styled, which never runs anything.