{"id":17084598,"url":"https://github.com/fleshgrinder/rust-exit-code","last_synced_at":"2025-04-12T21:25:32.681Z","repository":{"id":21573670,"uuid":"93301345","full_name":"Fleshgrinder/rust-exit-code","owner":"Fleshgrinder","description":"Commonly used exit codes for usage in applications.","archived":false,"fork":false,"pushed_at":"2022-06-16T23:44:48.000Z","size":9,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-11T22:47:42.343Z","etag":null,"topics":["cli","exit-codes","rust","rust-library","sysexits"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/exit-code","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fleshgrinder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-04T08:50:34.000Z","updated_at":"2024-01-12T19:21:05.000Z","dependencies_parsed_at":"2022-08-01T10:07:21.951Z","dependency_job_id":null,"html_url":"https://github.com/Fleshgrinder/rust-exit-code","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleshgrinder%2Frust-exit-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleshgrinder%2Frust-exit-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleshgrinder%2Frust-exit-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleshgrinder%2Frust-exit-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fleshgrinder","download_url":"https://codeload.github.com/Fleshgrinder/rust-exit-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248633304,"owners_count":21136852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","exit-codes","rust","rust-library","sysexits"],"created_at":"2024-10-14T13:08:02.306Z","updated_at":"2025-04-12T21:25:32.660Z","avatar_url":"https://github.com/Fleshgrinder.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust Exit Codes\nCommonly used exit codes for usage in applications.\n\nUsing appropriate exit codes greatly helps users of applications to assert them\nin their own scripts and take appropriate actions based on the returned code.\nSimply using the catchall exit code _1_ all the time does not help others in\nany way. Unless there is only a single source of error in the complete\napplication, which is very unlikely.\n\n## Installation\nAdd the following to your `Cargo.toml` file:\n\n```toml\n[dependencies]\nexit-code = \"1.0.0\"\n```\n\n## Usage\n```rust\nextern crate exit_code;\n\nfn main() {\n    use std::process::exit;\n    use exit_code::SUCCESS;\n\n    println!(\"Hello, World!\");\n    exit(SUCCESS);\n}\n```\n\nThis crate provides two additional functions that allow validation of exit\ncodes:\n\n- `is_reserved(exit_code) -\u003e bool` can be used to check if a given exit code\n  has a reserved meaning in a shell, refer to the API documentation for the\n  meaning of the reserved exit codes.\n- `is_valid(exit_code) -\u003e bool` can be used to check if a given exit code is\n  within the range `[0..256]` (anything below or beyond silently overflows).\n\n## References\n- Advanced Bash-Scripting Guide: [Appendix E. Exit Codes With Special Meanings](http://tldp.org/LDP/abs/html/exitcodes.html)\n- FreeBSD Man Pages: [`man sysexits(3)`](https://www.freebsd.org/cgi/man.cgi?query=sysexits)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffleshgrinder%2Frust-exit-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffleshgrinder%2Frust-exit-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffleshgrinder%2Frust-exit-code/lists"}