Exit codes for process termination
i32newtype for exit codes- Can represent any valid exit code
- Type safe, operations are restricted to what is valid for exit codes
- Includes standard exit codes and signal exit codes
- Integrate with
main,std::process, andstd::io::Error - Supports exiting silently (error message reported through another means)
Add to your Cargo.toml:
$ cargo add proc-exitOther crates that might be useful in testing command line programs.
- duct for orchestrating multiple processes.
- or commandspec for easier writing of commands
- rexpect for controlling interactive programs.
assert_cmdcan be reused to simplify controlling CLIs
Some crates that fill a similar role include:
- sysexit
- Uses an enum, making certain states unpresentable
- Includes signals
- Integrates with
std::processandstd::io::Error - Doesn't integrate with
main
- exit-code
i32constants and helper methods- Doesn't include signals
- Doesn't integrate with
main,std::process, orstd::io::Error
- exitcode
i32constants and helper methods- Doesn't include signals
- Doesn't integrate with
main,std::process, orstd::io::Error
- exitfailure
- Allows
Displayable errors to be used with?inmain()
- Allows
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/license/mit)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.