11 releases (stable)

2.0.0 Mar 4, 2023
1.2.0 Jan 1, 2023
1.1.4 Jun 27, 2021
1.1.2 Sep 25, 2020
0.2.1 Mar 22, 2020

#247 in Command-line interface

Download history 260/week @ 2024-02-25 188/week @ 2024-03-03 156/week @ 2024-03-10 126/week @ 2024-03-17 176/week @ 2024-03-24 283/week @ 2024-03-31 161/week @ 2024-04-07 161/week @ 2024-04-14 190/week @ 2024-04-21 231/week @ 2024-04-28 191/week @ 2024-05-05 163/week @ 2024-05-12 343/week @ 2024-05-19 200/week @ 2024-05-26 233/week @ 2024-06-02 235/week @ 2024-06-09

1,028 downloads per month
Used in 11 crates

MIT/Apache

10KB
106 lines

Quit

This crate allows cleanly exiting a program using a custom exit code, without the drawbacks of process::exit. Destructors will be called as usual, and the stack will be completely unwound.

It is always required to attach #[main] to the main function. Then, with_code can be called from almost anywhere in the program. Restrictions are noted in the documentation for that function.

GitHub Build Status

Usage

Add the following lines to your "Cargo.toml" file:

[dependencies]
quit = "2.0"

See the documentation for available functionality and examples.

Rust version support

The minimum supported Rust toolchain version is currently Rust 1.64.0.

Minor version updates may increase this version requirement. However, the previous two Rust releases will always be supported. If the minimum Rust version must not be increased, use a tilde requirement to prevent updating this crate's minor version:

[dependencies]
quit = "~2.0"

License

Licensing terms are specified in COPYRIGHT.

Unless you explicitly state otherwise, any contribution submitted for inclusion in this crate, as defined in LICENSE-APACHE, shall be licensed according to COPYRIGHT, without any additional terms or conditions.

Dependencies