{"id":17015969,"url":"https://github.com/j-tai/getargs","last_synced_at":"2025-03-17T09:31:15.959Z","repository":{"id":36302431,"uuid":"223227168","full_name":"j-tai/getargs","owner":"j-tai","description":"A truly zero-cost argument parser for Rust","archived":false,"fork":false,"pushed_at":"2023-06-24T21:18:03.000Z","size":74,"stargazers_count":42,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-20T12:26:33.838Z","etag":null,"topics":["argument-parser","argument-parsing","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/j-tai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-11-21T17:23:25.000Z","updated_at":"2024-04-12T18:09:41.000Z","dependencies_parsed_at":"2024-10-14T06:31:24.436Z","dependency_job_id":"9d1b2c22-237d-4a46-b7a9-b58eea93977e","html_url":"https://github.com/j-tai/getargs","commit_stats":{"total_commits":41,"total_committers":3,"mean_commits":"13.666666666666666","dds":"0.14634146341463417","last_synced_commit":"465398243dcd78352315e607bd1997dace4a80c4"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-tai%2Fgetargs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-tai%2Fgetargs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-tai%2Fgetargs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-tai%2Fgetargs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j-tai","download_url":"https://codeload.github.com/j-tai/getargs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858929,"owners_count":20359259,"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":["argument-parser","argument-parsing","rust"],"created_at":"2024-10-14T06:31:12.715Z","updated_at":"2025-03-17T09:31:15.638Z","avatar_url":"https://github.com/j-tai.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getargs\n\nAn argument parser that is truly zero-cost, similar to Unix's `getopts`.\n\n## About\n\n`getargs` is a low-level, efficient and versatile argument parser that\nworks similarly to `getopts`. It works by producing a stream of options,\nand after each option, your code decides whether to require and retrieve\nthe value for the option or not.\n\nYou don't have to declare a list of valid options up-front, so `getargs`\ndoes not have to allocate space for them or spend runtime searching for\nthem. This also means that you have to write your own help message, but\nsince `--help` is just another flag, there are no restrictions on what\nyou do with it.\n\n## Features\n\n* Short `-f` and long `--flag` flags\n* Required implicit values `-i VALUE` and `--implicit VALUE`\n* Required or optional explicit values `-eVALUE` and `--explicit=VALUE`\n* Positional arguments and `--`\n* Parse options at the beginning of the argument list, or anywhere\n\n## Benefits\n\n* Zero cost\n* Zero copy\n* Zero unsafe code\n* Zero dependencies\n* Zero allocation\n* Simple to use yet versatile\n* `#![no_std]`-compatible\n* Compatible with `\u0026str` and `\u0026[u8]`\n\n## Performance\n\n`getargs` has had a lot of attention put into profiling and\noptimization, and on a modern machine it takes under 0.2μs to parse a\nshort array of 12 arguments.\n\nIn our testing, `getargs` is faster than every other argument parsing\nlibrary on crates.io. Its closest competitor is `gumdrop`, which is only\n~30% slower in the worst case, and its second-closest competitor is\n`getopt`, which takes three times as long. Other libraries degrade\nquickly; `clap` takes 45x longer. (This is not an entirely fair\ncomparison though, as `clap` is not just an argument-parsing library,\nbut an entire command-line application framework. It is perhaps\noverqualified for simple tasks.)\n\n## Example\n\nFor examples, see [the `examples` directory][./examples/] for small\nprograms that you can compile and run yourself to see how `getargs`\nworks.\n\n## License\n\n[MIT.](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-tai%2Fgetargs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj-tai%2Fgetargs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-tai%2Fgetargs/lists"}