#exitcode #sysexits

sysexits

The system exit codes as defined by <sysexits.h>

10 releases

Uses new Rust 2021

0.3.4 Nov 24, 2022
0.3.3 Oct 24, 2022
0.3.2 Sep 18, 2022
0.3.0 Jun 10, 2022
0.1.1 May 30, 2022

#81 in Operating systems

Download history 157/week @ 2022-08-19 188/week @ 2022-08-26 297/week @ 2022-09-02 176/week @ 2022-09-09 291/week @ 2022-09-16 261/week @ 2022-09-23 265/week @ 2022-09-30 504/week @ 2022-10-07 376/week @ 2022-10-14 463/week @ 2022-10-21 351/week @ 2022-10-28 306/week @ 2022-11-04 274/week @ 2022-11-11 481/week @ 2022-11-18 343/week @ 2022-11-25 208/week @ 2022-12-02

1,341 downloads per month
Used in 5 crates

Apache-2.0 OR MIT

23KB
340 lines

sysexits-rs

CI Version Docs License

sysexits-rs (sysexits) is a library that provides the system exit code constants as defined by <sysexits.h>.

This library implements the Termination trait, so this can be returned from the main function.

Usage

Add this to your Cargo.toml:

[dependencies]
sysexits = "0.3.4"

Example

fn main() -> sysexits::ExitCode {
    let bytes = [0xf0, 0x9f, 0x92, 0x96];
    match std::str::from_utf8(&bytes) {
        Ok(string) => {
            println!("{string}");
            sysexits::ExitCode::Ok
        }
        Err(err) => {
            eprintln!("{err}");
            sysexits::ExitCode::DataErr
        }
    }
}

Documentation

See the documentation for more details.

Minimum supported Rust version

The minimum supported Rust version (MSRV) of this library is v1.61.0 or later.

Changelog

Please see CHANGELOG.adoc.

Contributing

Please see CONTRIBUTING.adoc.

License

Copyright (C) 2022 Shun Sakai and Contributors (see AUTHORS.adoc)

This library is distributed under the terms of either the Apache License 2.0 or the MIT License.

See COPYRIGHT, LICENSE-APACHE and LICENSE-MIT for more details.

No runtime deps