Skip to main content

exit_code_for_parse_error

Function exit_code_for_parse_error 

Source
pub fn exit_code_for_parse_error(err: &Error) -> i32
Expand description

Map a clap parse failure onto the process exit code.

--help and --version are reported by clap as errors but are successful invocations. Every other parse failure exits 1, preserving the exit status the hand-rolled parser used for an unknown command, a missing argument, or a bad option value.