{"id":36724670,"url":"https://github.com/lukaswrz/readarg","last_synced_at":"2026-01-12T12:00:09.082Z","repository":{"id":164542121,"uuid":"368585410","full_name":"lukaswrz/readarg","owner":"lukaswrz","description":"A small, C99, single-header, zero-allocation, dependency-free, public domain argument parsing library","archived":false,"fork":false,"pushed_at":"2024-08-07T23:59:21.000Z","size":102,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-08T02:32:17.023Z","etag":null,"topics":["argument-parsing","c","cli","command-line","header-only","library","parser","single-header","zero-allocation"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukaswrz.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":"2021-05-18T15:45:07.000Z","updated_at":"2024-08-07T23:59:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"340da80a-ed52-461d-ac4b-7f2ee2c98998","html_url":"https://github.com/lukaswrz/readarg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lukaswrz/readarg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaswrz%2Freadarg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaswrz%2Freadarg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaswrz%2Freadarg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaswrz%2Freadarg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukaswrz","download_url":"https://codeload.github.com/lukaswrz/readarg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaswrz%2Freadarg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-parsing","c","cli","command-line","header-only","library","parser","single-header","zero-allocation"],"created_at":"2026-01-12T12:00:08.482Z","updated_at":"2026-01-12T12:00:09.018Z","avatar_url":"https://github.com/lukaswrz.png","language":"C","readme":"# readarg\n\n## Features\n\n* Short options (`-f`)\n  * Short options with a value directly following the option character\n    (`-fvalue`)\n  * Short options with a value as a separate `argv` element (`-f value`)\n  * Grouped short options (`-asdf`, `-asdfvalue`, `-asdf value`)\n* Long options (`--file`)\n  * Long options with a value separated by an equal sign (`--file=value`)\n  * Long options with a value as a separate `argv` element (`--file value`)\n* Multiple values are represented in an array (`-f value1 -f value2 ...`)\n* Operands mixed with options (`-f value1 operand1 -f value2 operand2`)\n\n## Usage\n\nInstalling this library is as simple as downloading the header file, dropping\nit into your project directory and including it. Alternatively, you could choose\nto use a Git submodule. In any case, attribution is not required.\n\nIt is required that one file in your project defines the\n`READARG_IMPLEMENTATION` macro before including the `readarg.h` header file,\nas with any other single-header library.\n\nAn example for how to use readarg can be found in `test/test.c`. If you want to\nsee how readarg represents options and operands, run `test.bash`.\n\n## Terminology\n\nIf you're wondering what exactly the difference between an option, an operand or\nan argument is, you can skim this document to get a better idea:\n[POSIX Utility Conventions](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html)\n\n## Internals\n\nreadarg permutes `argv` to handle multiple values for each option and to assign\nvalues to operands. The advantage of this approach is as follows:\n\n* Allocations are not needed because the memory provided by `argv` is reused\n* It's fairly simple to represent all of this data in an intuitive data\n  structure (in my opinion anyway)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukaswrz%2Freadarg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukaswrz%2Freadarg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukaswrz%2Freadarg/lists"}