https://github.com/rust-cli/proc-exit
Exit codes for process termination
https://github.com/rust-cli/proc-exit
Last synced: 2 months ago
JSON representation
Exit codes for process termination
- Host: GitHub
- URL: https://github.com/rust-cli/proc-exit
- Owner: rust-cli
- License: apache-2.0
- Created: 2020-11-20T02:15:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-20T18:11:52.000Z (4 months ago)
- Last Synced: 2025-04-02T06:06:56.970Z (3 months ago)
- Language: Rust
- Homepage: docs.rs/proc-exit
- Size: 203 KB
- Stars: 24
- Watchers: 5
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# proc-exit
> Exit codes for process termination
[](https://codecov.io/gh/rust-cli/proc-exit)
[][Documentation]

[][Crates.io]## 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`, and `std::io::Error`
- Supports exiting silently (error message reported through another means)## Install
Add to your `Cargo.toml`:
```console
$ cargo add proc-exit
```## Relevant crates
Other crates that might be useful in testing command line programs.
- [duct][duct] for orchestrating multiple processes.
- or [commandspec][commandspec] for easier writing of commands
- [rexpect][rexpect] for controlling interactive programs.
- [`assert_cmd`][assert_cmd] can be reused to simplify controlling CLIs[duct]: https://crates.io/crates/duct
[rexpect]: https://crates.io/crates/rexpect
[assert_cmd]: https://crates.io/crates/assert_cmd
[commandspec]: https://crates.io/crates/commandspec## Related crates
Some crates that fill a similar role include:
- [sysexit][sysexit]
- Uses an enum, making certain states unpresentable
- Includes signals
- Integrates with `std::process` and `std::io::Error`
- Doesn't integrate with `main`
- [exit-code][exit-code]
- `i32` constants and helper methods
- Doesn't include signals
- Doesn't integrate with `main`, `std::process`, or `std::io::Error`
- [exitcode][exitcode]
- `i32` constants and helper methods
- Doesn't include signals
- Doesn't integrate with `main`, `std::process`, or `std::io::Error`
- [exitfailure][exitfailure]
- Allows `Display`able errors to be used with [`?` in `main()`](https://github.com/rust-lang/rust/issues/43301)[sysexit]: https://crates.io/crates/sysexit
[exit-code]: https://crates.io/crates/exit-code
[exitcode]: https://crates.io/crates/exitcode
[exitfailure]: https://crates.io/crates/exitfailure## License
Licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or )
* MIT license ([LICENSE-MIT](LICENSE-MIT) or )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.[Crates.io]: https://crates.io/crates/proc-exit
[Documentation]: https://docs.rs/proc-exit