Crate semantic_exit

Source
Expand description

Defines semantic exit codes which may be used by Command Line tools to aid in debugging and instrumentation.

This package defines exit codes in two ranges:

  • Exit Codes 80-99 indicate a user error of some sort.
  • Exit Codes 100-119 indicate software or system error of some sort.

Enums§

Code
The exit code that is passed to the system call exit when the program terminates. Conventionally, the value zero indicates success and all other values (1-255) indicate failure.
Error

Functions§

exit
from_signal
Returns the exit code that corresponds to when a program exits in response to a signal.
is_signal
Reports whether an exit code is derived from a signal. It returns true if the code is in the range 128-255 and false if not.
is_software_error
Reports whether an exit code is a software error. It returns true if the code is in the range 100-119 and false if not.
is_user_error
Reports whether an exit code is a user error. It returns true if the code is in the range 80-99 and false if not.