Expand description
Help text: static data the derive emits, rendered only when asked for.
Nothing here runs during a successful parse. A command’s Command sits in
read-only data until --help (or -h) returns it inside an
ErrorKind::HelpRequested, and
render turns it into text.
Re-exports§
Structs§
- Command
- One command’s help: what it is, what it takes, what it contains.
- Example
- A command line to try.
- Heading
- What a section of the page says before its entries.
- Item
- A flag or positional.
- Style
- How help and errors are painted: a
Palettefor a terminal of someDepth. The escapes never count toward a column’s width. - Sub
- A subcommand as its parent lists it.
Functions§
- render
- Render
command’s help, plain, wrapped towidth.pathis the command line leading to it (program name, then subcommand names);longselects--helpover-h. - render_
styled render, wrapped towidthcolumns and painted withstyle.- render_
width render, wrapped towidthcolumns.- resolve
- The command a
help a b …line asks about: follow each word throughroot’s subcommands until one names none. Gives it and the names followed. - width
- The width help wraps to:
COLUMNSwhen it is a positive number, so a user or a test can say what to assume; else, with theterminal-sizefeature, the width of the terminal on standard output; else 100.