9 releases (stable)
2.0.1 | Mar 14, 2023 |
---|---|
2.0.0 | Oct 4, 2022 |
1.0.3 | Dec 28, 2021 |
1.0.2 | Jan 30, 2021 |
0.1.0 | Nov 22, 2020 |
#60 in Operating systems
7,142 downloads per month
Used in 15 crates
(14 directly)
26KB
256 lines
proc-exit
Exit codes for process termination
Features
i32
newtype 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)
Install
Add to your Cargo.toml
:
$ cargo add proc-exit
Relevant crates
Other 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_cmd
can be reused to simplify controlling CLIs
Related crates
Some crates that fill a similar role include:
- sysexit
- Uses an enum, making certain states unpresentable
- Includes signals
- Integrates with
std::process
andstd::io::Error
- Doesn't integrate with
main
- exit-code
i32
constants and helper methods- Doesn't include signals
- Doesn't integrate with
main
,std::process
, orstd::io::Error
- exitcode
i32
constants and helper methods- Doesn't include signals
- Doesn't integrate with
main
,std::process
, orstd::io::Error
- exitfailure
- Allows
Display
able errors to be used with?
inmain()
- Allows
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
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.