9 releases (stable)

1.1.4 Jun 27, 2021
1.1.3 Apr 22, 2021
1.1.2 Sep 25, 2020
1.1.0 Jul 9, 2020
0.1.0 Mar 15, 2020

#80 in Command-line interface

Download history 204/week @ 2021-04-02 220/week @ 2021-04-09 76/week @ 2021-04-16 69/week @ 2021-04-23 157/week @ 2021-04-30 132/week @ 2021-05-07 124/week @ 2021-05-14 73/week @ 2021-05-21 114/week @ 2021-05-28 163/week @ 2021-06-04 59/week @ 2021-06-11 53/week @ 2021-06-18 148/week @ 2021-06-25 78/week @ 2021-07-02 67/week @ 2021-07-09 104/week @ 2021-07-16

566 downloads per month
Used in 3 crates

MIT/Apache

15KB
185 lines

Quit

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

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 = "1.1"

See the documentation for available functionality and examples.

Rust version support

The minimum supported Rust toolchain version is currently Rust 1.32.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