10 releases (stable)

2.0.2 Jul 25, 2024
2.0.1 Mar 14, 2023
2.0.0 Oct 4, 2022
1.0.3 Dec 28, 2021
0.3.0 Nov 23, 2020

#57 in Operating systems

Download history 2009/week @ 2024-08-19 2205/week @ 2024-08-26 2782/week @ 2024-09-02 2046/week @ 2024-09-09 3935/week @ 2024-09-16 3923/week @ 2024-09-23 4546/week @ 2024-09-30 3406/week @ 2024-10-07 4222/week @ 2024-10-14 3899/week @ 2024-10-21 3738/week @ 2024-10-28 2893/week @ 2024-11-04 2280/week @ 2024-11-11 2114/week @ 2024-11-18 2636/week @ 2024-11-25 2900/week @ 2024-12-02

10,078 downloads per month
Used in 20 crates (19 directly)

MIT/Apache

31KB
262 lines

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

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.

No runtime deps