Skip to main content

parse_or_exit

Function parse_or_exit 

Source
pub fn parse_or_exit<T: Parser + CommandFactory>() -> T
Expand description

Parse arguments, intercepting clap errors when machine mode is on.

Replaces T::parse() at binary entry points. Under --machine, parse errors and --help / --version are converted into a structured JsonEnvelope on stdout and the process exits with the appropriate ExitCode. Without --machine, behaves exactly like [Parser::parse].