Skip to main content

clap_error

Function clap_error 

Source
pub(crate) fn clap_error(e: &Error) -> Box<dyn Error>
Expand description

A refusal from the parser, as an error from this binary.

-h and -V come through here too and are not refusals: clap prints them on stdout and exits 0, which is what mira -h | less needs, so they take its exit rather than this one. Everything else would take clap’s other exit — its own error: prefix, on stderr, code 2 — and this binary’s contract is mira: <sentence> and code 1 for anything a supervisor might read. The sentence is clap’s; only the prefix and the code are ours.