Skip to main content

try_emit

Function try_emit 

Source
pub fn try_emit<C: CommandFactory>() -> Result<bool>
Available on crate feature help only.
Expand description

Print styled help to stdout when the process argv asks for it, and return true. Return false and print nothing otherwise.

Colour comes from the --color and --no-color flags in argv. Use try_emit_with_options to control the width and style policy.

§Errors

Returns the error from writing help to stdout.

§Panics

Panics when the command disables -h/--help or -V/--version.