The current parser for commandline arguments isn't perfect. It doesn't allow arguments to follow short options without spaces (-h20 should be equivalent to -h 20). The code is messy, and error handling is not as easy as it could be.
There are many available Zig libraries, and I could use one. I do think it would be best to just improve my current custom parser. Zf is simple and doesn't need much of the complexity that comes from a general-purpose argument parser.
Here are some goals for an improved version:
[x] Move code to a new file (ArgParse.zig?)
[x] Handle short options with arguments and no spaces between
The current parser for commandline arguments isn't perfect. It doesn't allow arguments to follow short options without spaces (
-h20
should be equivalent to-h 20
). The code is messy, and error handling is not as easy as it could be.There are many available Zig libraries, and I could use one. I do think it would be best to just improve my current custom parser. Zf is simple and doesn't need much of the complexity that comes from a general-purpose argument parser.
Here are some goals for an improved version:
ArgParse.zig
?)