{"id":33926291,"url":"https://github.com/gay-pizza/jaarg","last_synced_at":"2025-12-12T10:09:31.363Z","repository":{"id":303043319,"uuid":"771985110","full_name":"gay-pizza/jaarg","owner":"gay-pizza","description":"Dependency-free const-y argument parser library for Rust","archived":false,"fork":false,"pushed_at":"2025-11-26T04:44:22.000Z","size":81,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-29T06:25:14.183Z","etag":null,"topics":["argument-parsers","argument-parsing","arguments-parser","const","nostd","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/jaarg","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gay-pizza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.Apache-2.0","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-14T10:13:30.000Z","updated_at":"2025-11-26T10:01:18.000Z","dependencies_parsed_at":"2025-07-05T10:53:47.532Z","dependency_job_id":null,"html_url":"https://github.com/gay-pizza/jaarg","commit_stats":null,"previous_names":["gay-pizza/jaarg"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/gay-pizza/jaarg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gay-pizza%2Fjaarg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gay-pizza%2Fjaarg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gay-pizza%2Fjaarg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gay-pizza%2Fjaarg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gay-pizza","download_url":"https://codeload.github.com/gay-pizza/jaarg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gay-pizza%2Fjaarg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27680583,"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","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["argument-parsers","argument-parsing","arguments-parser","const","nostd","rust"],"created_at":"2025-12-12T10:09:30.545Z","updated_at":"2025-12-12T10:09:31.350Z","avatar_url":"https://github.com/gay-pizza.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jaarg argument parser library #\n\nDependency-free, const (mostly), no magic macros, `no_std` \u0026 no alloc (though nicer with those).\nSome say it can parse your arguments.\n\n### Obligatory fancy banners ###\n\u003cdiv\u003e\n \u003ca href=\"https://crates.io/crates/jaarg\"\u003e\n  \u003cimg src=\"https://img.shields.io/crates/v/jaarg.svg?logo=rust\u0026style=for-the-badge\" alt=\"Crates version\" /\u003e\n \u003c/a\u003e\n \u003ca href=\"#licensing\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT%20%7C%20Apache--2.0-green.svg?style=for-the-badge\" alt=\"MIT OR Apache-2.0 License\" /\u003e\n \u003c/a\u003e\n\u003c/div\u003e\n\n### Example usage ###\n```rust\n// Variables for arguments to fill\nlet mut file = PathBuf::new();\nlet mut out: Option\u003cPathBuf\u003e = None;\nlet mut number = 0;\n\n// Set up arguments table\nenum Arg { Help, Number, File, Out }\nconst OPTIONS: Opts\u003cArg\u003e = Opts::new(\u0026[\n  Opt::help_flag(Arg::Help, \u0026[\"-h\", \"--help\"]).help_text(\"Show this help and exit.\"),\n  Opt::value(Arg::Number, \u0026[\"-n\", \"--number\"], \"value\")\n    .help_text(\"Optionally specify a number (default: 0)\"),\n  Opt::positional(Arg::File, \"file\").required()\n    .help_text(\"Input file.\"),\n  Opt::positional(Arg::Out, \"out\")\n    .help_text(\"Output destination (optional).\")\n]).with_description(\"My simple utility.\");\n\n// Parse command-line arguments from `std::env::args()`\nmatch OPTIONS.parse_easy(|program_name, id, _opt, _name, arg| {\n  match id {\n    Arg::Help =\u003e {\n      OPTIONS.print_full_help(program_name);\n      return Ok(ParseControl::Quit);\n    }\n    Arg::Number =\u003e { number = str::parse(arg)?; }\n    Arg::File   =\u003e { file = arg.into(); }\n    Arg::Out    =\u003e { out = Some(arg.into()); }\n  }\n  Ok(ParseControl::Continue)\n}) {\n  ParseResult::ContinueSuccess =\u003e (),\n  ParseResult::ExitSuccess     =\u003e std::process::exit(0),\n  ParseResult::ExitError       =\u003e std::process::exit(1),\n}\n\n// Print the result variables\nprintln!(\"{file:?} -\u003e {out:?} (number: {number:?})\",\n  out = out.unwrap_or(file.with_extension(\"out\")));\n```\n\n### Changelog ###\n\nv0.2.2:\n * Fixed coerced `ArgumentError` not being rewritten for positional arguments.\n * Moved top level includes to `pub use`.\n * Hopefully work around licence \u0026 read me texts not being included in crate.\n\nv0.2.1:\n * Fixed licence field in `Cargo.toml`.\n\nv0.2.0:\n * Change licence from `MIT` to `MIT OR Apache-2.0`.\n * Moved `Opts::parse_map` into newly introduced `alloc` crate, making it accessible for `no_std` users.\n * More generic \u0026 flexible help API: removed forced newline, moved error writer to `StandardErrorUsageWriter`,\n    generalised \"Usage\" line in standard full writer, enough public constructs to roll a custom help writer.\n * Added the ability to exclude options from short usage, full help, or both.\n * More tests for validating internal behaviour \u0026 enabled CI on GitHub.\n * Added new `no_std` examples.\n\nv0.1.1:\n * Fixed incorrect error message format for coerced parsing errors.\n * Cleaned up docstring formatting.\n * Added basic example.\n\nv0.1.0:\n * Initial release.\n\n### Roadmap ###\n\nNear future:\n * More control over parsing behaviour (getopt style, no special casing shorts for Windows style flags, etc.)\n * More practical examples.\n\nLong term:\n * Strategy for handling exclusive argument groups.\n * Make use of const traits when they land to improve table setup.\n\n### Projects using jaarg (very cool) ###\n * [Sprout bootloader](https://github.com/edera-dev/sprout)\n * [lbminfo](https://github.com/ScrelliCopter/colourcyclinginthehousetonight/tree/main/lbminfo)\n\n### Licensing ###\n\njaarg is dual-licensed under either the [MIT](LICENSE.MIT) or [Apache 2.0](LICENSE.Apache-2.0) licences.\nPick whichever works best for your project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgay-pizza%2Fjaarg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgay-pizza%2Fjaarg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgay-pizza%2Fjaarg/lists"}