Skip to main content

Module help

Module help 

Source
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§

pub use crate::color::Depth;
pub use crate::color::Palette;
pub use crate::color::Theme;

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 Palette for a terminal of some Depth. 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 to width. path is the command line leading to it (program name, then subcommand names); long selects --help over -h.
render_styled
render, wrapped to width columns and painted with style.
render_width
render, wrapped to width columns.
resolve
The command a help a b … line asks about: follow each word through root’s subcommands until one names none. Gives it and the names followed.
width
The width help wraps to: COLUMNS when it is a positive number, so a user or a test can say what to assume; else, with the terminal-size feature, the width of the terminal on standard output; else 100.