Crate cerm

Source
Expand description

§cerm — C Inspired Error Reporting Macros

Cerm (/sɜːm/) provides a few handy macros in the style of BSD C’s <err.h> for error-reporting to the user. These macros just remove some of the boilerplate of having to prefix your diagnostic messages with progname: everytime you want to exit the program.

Macros§

err
The same thing as err_code!, but the exit code is always 1.
err_code
Print a diagnostic message to the standard error and exit with a given code.
require
Require that an expression returns Result::Ok or Option::Some.
warn
Print a diagnostic message to the standard error.