proc-exit

Crates.ioproc-exit
lib.rsproc-exit
version2.0.2
sourcesrc
created_at2020-11-22 03:51:16.945377
updated_at2024-07-25 14:36:16.625318
descriptionExit codes for process termination
homepage
repositoryhttps://github.com/rust-cli/proc-exit
max_upload_size
id314908
size42,668
Maintainers (github:rust-cli:maintainers)

documentation

https://docs.rs/proc-exit

README

proc-exit

Exit codes for process termination

codecov Documentation License Crates Status

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:

$ cargo add proc-exit

Relevant crates

Other crates that might be useful in testing command line programs.

  • duct for orchestrating multiple processes.
  • 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 and std::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, or std::io::Error
  • exitcode
    • i32 constants and helper methods
    • Doesn't include signals
    • Doesn't integrate with main, std::process, or std::io::Error
  • exitfailure
    • Allows Displayable errors to be used with ? in main()

License

Licensed under either of

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.

Commit count: 130

cargo fmt