Sysexits-rs (sysexits) is a library that provides the system exit code constants

Overview

sysexits-rs

CI Version Docs License

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

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.0"

Example

{ eprintln!("{err}"); sysexits::ExitCode::DataErr } } }">
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.

Comments
  • [Enhancement] Add Citation Meta Data

    [Enhancement] Add Citation Meta Data

    This Pull Requests introduces initial citation meta data for this project using the Citation File Format standard. I also added the automatic validator such that one can rely on the correctness of the configuration file.

    The introduced citation meta data are rendered by GitHub to a "Cite this repository" option on this project's welcome page. People interested in this project can then cite it in their papers and theses.

    The meta data can be freely enriched with further fields as required. Furthermore, there is the option to add a list of references to it. This way, you can cite the used resources in order to create this project.

    Please tell me whether the suggested initial meta data set is correct and if I should add further entries. For instance, there are the options to add the crate's description on crates.io as repository-artifact or to alter the URL to the documentation website. I decided to leave these options open in order to discuss the other entries, at first.

    opened by kevinmatthes 3
  • Implement `Display` trait and corresponding test

    Implement `Display` trait and corresponding test

    Hi, @sorairolake,

    First of all, thank you for your crate! I apply it in some of my Rust binary projects and it helps me a lot to handle occurring errors.

    But thereby, I encountered that a certain feature seemed to be missing: an implementation of the Display trait. This is useful in order to provide additional information for debugging but also for the resulting application itself in case an unhandled error should occur.

    Thus, I would like to contribute a working implementation of the Display trait to your project. The change not only brings the implementation itself, but also a dedicated test as well as some initial documentation.

    The code is already linted, formatted and checked. The commit message guidelines were applied.

    Please consider to accept this change in order to add a further useful feature to your library.

    opened by kevinmatthes 2
  • [Bugfix] Fix CITATION.cff and bump2version Settings (#3)

    [Bugfix] Fix CITATION.cff and bump2version Settings (#3)

    Hi, @sorairolake!

    I noticed that the release date given in the CITATION.cff did not match the actual release date of v0.3.3, so I fixed this issue. (Unfortunately, bump2version does not automatically enter the correct release dates on call.) I saw the outdated release date when I cited this project in a documentation.

    Furthermore, I removed .bumpversion.cfg from itself. The file will always update itself. This was something I did not knew when I originally suggested it in #5, I am sorry about that.

    opened by kevinmatthes 1
  • Bump actions-rs/cargo from 1.0.1 to 1.0.3

    Bump actions-rs/cargo from 1.0.1 to 1.0.3

    Bumps actions-rs/cargo from 1.0.1 to 1.0.3.

    Changelog

    Sourced from actions-rs/cargo's changelog.

    [1.0.3] - 2019-11-24

    Fixed

    • Rustup installer for Windows VMs is downloaded via HTTPS

    [1.0.2] - 2019-11-09

    Added

    • Problem matcher which will highlight warnings and errors in the cargo output

    Changed

    • Use @action-rs/core package for cargo/cross execution
    Commits
    • 844f368 Release v1.0.3
    • d2cb01e Bump @​types/node from 12.12.8 to 12.12.12
    • e0944f3 Bump ts-jest from 24.1.0 to 24.2.0
    • dafd805 Bump @​actions-rs/core from 0.0.7 to 0.0.8
    • 131c46c Bump @​types/jest from 24.0.22 to 24.0.23
    • 1077360 Bump @​types/node from 12.12.7 to 12.12.8
    • 0362540 Bump typescript from 3.6.4 to 3.7.2
    • d57a4be Bump @​types/jest from 24.0.20 to 24.0.22
    • 7011238 Release v1.0.2
    • 989c5b6 Bump @​types/node from 12.11.1 to 12.12.7
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump actions-rs/toolchain from 1.0.6 to 1.0.7

    Bump actions-rs/toolchain from 1.0.6 to 1.0.7

    Bumps actions-rs/toolchain from 1.0.6 to 1.0.7.

    Changelog

    Sourced from actions-rs/toolchain's changelog.

    Changelog

    All notable changes to this project will be documented in this file.

    The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

    Commits
    • 16499b5 Bump dependencies
    • 4d9a2b1 [Security] Bump @​actions/core from 1.2.3 to 1.2.6
    • 83a0369 Fix dead link to Rust toolchain specification
    • 3639e8f README: Fix link to toolchain file.
    • 69f9ca1 Update README.md
    • b223206 Fix ts file identification in pre-commit hook
    • 7f00d10 Small typo
    • 4d38309 Freeze changelog for v1.0.6 release
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • [Enhancement] Add Automatic Version Increment

    [Enhancement] Add Automatic Version Increment

    This Pull Request adds a new configuration file: .bumpversion.cfg. This file controls the behaviour of bump2version, a Python 3 CLI to automatically update all version numbers in the whole repository. It is self-maintaining, i.e. it will even update itself.

    I also added a new recipe to the justfile: bump {{part}}. At the moment, this project is versioned according to the pattern major.minor.patch. Just pass one of those parts to the recipe bump and all your version numbers will be updated automatically. (Release dates are not supported by bump2version.)

    You now just need to call, for instance, just bump patch for updating immediately from 0.3.2 to 0.3.3 in all files. The CFF release date needs to be updated by hand as well as the CHANGELOG which also still needs to be specified manually. Furthermore, the tool will complain if there are uncommitted changes. Use bump2version <part> --allow-dirty to override this behaviour once.

    bump2version is free and open source, it is licensed MIT and maintained here: https://github.com/c4urself/bump2version.

    opened by kevinmatthes 1
  • [Bugfix] Adjust URLs in `CITATION.cff`

    [Bugfix] Adjust URLs in `CITATION.cff`

    This Pull Request adjusts the URLs specified in the CITATION.cff. It now contains information regarding the documentation website (configured to be the main website) as well as the library description on crates.io (configured to be the place with final state artifacts).

    By the way, I found a tool which makes adjusting the version information in the configuration files easier. It is named bump2version and is written in Python 3. For integration, one just needs to define a plain text configuration file to be stored in the repository root. I tried to set it up for this project but there are still some open points; automatically adjusting the release dates does not seem to be possible, for instance, and the changelog cannot be updated due to the URL being stored as a magic number. Shall I submit the recent progress in a separate Pull Request anyway, @sorairolake? The automatism is integrated into the justfile and just two files are left for update by hand.

    opened by kevinmatthes 1
  • Fix linter warning for `examples/cat.rs`

    Fix linter warning for `examples/cat.rs`

    Hi, @sorairolake,

    When I explored the code base, I noticed that the linter did not totally agree on the source file example/cat.rs. This change fixes the linter warning properly.

    opened by kevinmatthes 1
Owner
Shun Sakai
I :heart: FOSS
Shun Sakai
Calculation of Wigner symbols and related constants

Calculation of Wigner symbols and related constants This crate computes Wigner 3j coefficients and Clebsch-Gordan coefficients in pure Rust. The calcu

Guillaume Fraux 3 Jan 19, 2022
Choose Rust types at compile-time via boolean constants

condtype Choose Rust types at compile-time via boolean constants, brought to you by Nikolai Vazquez. If you find this library useful, consider starrin

Nikolai Vazquez 36 May 8, 2023
This library provides a convenient derive macro for the standard library's std::error::Error trait.

derive(Error) This library provides a convenient derive macro for the standard library's std::error::Error trait. [dependencies] therror = "1.0" Compi

Sebastian Thiel 5 Oct 23, 2023
Downloads and provides debug symbols and source code for nix derivations to gdb and other debuginfod-capable debuggers as needed.

nixseparatedebuginfod Downloads and provides debug symbols and source code for nix derivations to gdb and other debuginfod-capable debuggers as needed

Guillaume Girol 16 Mar 6, 2023
A library that allows for the arbitrary inspection and manipulation of the memory and code of a process on a Linux system.

raminspect raminspect is a crate that allows for the inspection and manipulation of the memory and code of a running process on a Linux system. It pro

Liam Germain 24 Sep 26, 2023
First project in rust which will be to make an accounts system & Leaderboard/Score system

rust-backend this is my first project in rust which will be to make a backend for compsci project it will include: Accounts, Player Achievements (if I

NaughtyDog6000 2 Jul 13, 2023
Irx-config - The library provides convenient way to represent/parse configuration from different sources

The irx-config library provides convenient way to represent/parse configuration from different sources. The main goals is to be very easy to use and t

Andriy Bakay 2 Sep 14, 2022
Rust library that provides helpers for testing resilience of I/O operations.

partial-io Helpers for testing I/O behavior with partial, interrupted and blocking reads and writes. This library provides: PartialRead and PartialWri

null 31 Oct 26, 2022
Crates.io library that provides high-level APIs for obtaining information on various entertainment media such as books, movies, comic books, anime, manga, and so on.

Crates.io library that provides high-level APIs for obtaining information on various entertainment media such as books, movies, comic books, anime, manga, and so on.

consumet-rs 5 Aug 13, 2023
Emacs client for ycmd, the code completion system.

This package is currently unmaintained! If you want to take over maintenance, let me know in an issue. emacs-ycmd emacs-ycmd is a client for ycmd, the

Austin Bingham 381 Dec 22, 2022
Raw C Shell: interact with your operating system using raw C code, because why not?

rcsh Raw C Shell is a minimalist shell with no built in commands. You write entirely in C code and use return; to execute your code. Unlike that silly

null 4 Feb 7, 2023
languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments!

languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments! Overview Install MacO

Dustin Blackman 17 Dec 25, 2022
ChatGPT-Code-Review is a Rust application that uses the OpenAI GPT-3.5 language model to review code

ChatGPT-Code-Review is a Rust application that uses the OpenAI GPT-3.5 language model to review code. It accepts a local path to a folder containing code, and generates a review for each file in the folder and its subdirectories.

Greg P. 15 Apr 22, 2023
Code-shape is a tool for extracting definitions from source code files

Code-shape Code-shape is a tool that uses Tree-sitter to extract a shape of code definitions from a source code file. The tool uses the same language

Andrew Hlynskyi 3 Apr 21, 2023
rehype plugin to use tree-sitter to highlight code in pre code blocks

rehype-tree-sitter rehype plugin to use tree-sitter to highlight code in <pre><code> blocks Contents What is this? When should I use this? Install Use

null 5 Jul 25, 2023
A simple program that provides DBus interface to control display temperature and brightness under wayland without flickering

wl-gammarelay-rs Like wl-gammarelay, but written in rust, runs on a single thread, has three times less SLOC and uses DBus (for simplicity). Dbus inte

Max Verevkin 33 Nov 23, 2022
This PAM module provides ssh-agent based authentication

PAM-RSSH This PAM module provides ssh-agent based authentication. The primary design goal is to avoid typing password when you sudo on remote servers.

Yuxiang Zhang 21 Dec 14, 2022
Wena is a micro-framework that provides an elegant starting point for your console application.

Wena was created by Nuno Maduro, and is a Rust Lang micro-framework that provides an elegant starting point for your console application. This project

null 251 Dec 11, 2022
Provides a mock Ambi client that emulates real sensor hardware such as an Edge client

ambi_mock_client Provides a mock Ambi client that emulates real sensor hardware such as an Edge client. Usage You must have Rust installed to build am

Rust Never Sleeps 2 Apr 1, 2022