argparser
Repo: https://codeberg.org/zmitchell/argparser
Not a ton to see here because it’s mostly a copy-paste-edit job, but I’m posting in case anyone else has wanted this. I like the philosophy of the argument parser in Tigerbeetle’s repository and wanted to use it in some of my projects, so I copied it out of their repo and made it slightly friendlier to use for other projects (e.g. doesn’t depend on stdx.zig or snaptest.zig from their repository).
The README contains a full list of changes compared to the upstream parser, but the highlights are:
- Updated for Zig 0.16.0
- Doesn’t
exiton error - Naming follows Zig conventions (e.g. camel case for function names)
ohsnapfor snapshot testing (thank you @mnemnion)
There’s a full description in the README, but the short version of what sets this argument parser apart is:
- Long arguments only (e.g.
--foo, not-f).-h/--helpis an exception
--foo=bar, not--foo bar.- Handwritten help text instead of generating it from comments.
Supported Zig versions
Zig 0.16.0
(No AI usage, for the record. All bugs, typos, etc were lovingly handcrafted.)