I want to use the architecture used by zig’s own parser to create a really fast cli argument parser, that supports all the goodies. Then we can hook it to python and typescript via FFI.
Syntax
This is not formal regex or anything
This is just for me to easily see what I need to implement
./binary --[a-Z0-9]+ [value]? -[aZ] [value]?
- A
value
will have its own parsers, for identifying the type of whats being parsed. i.e numbers, strings, ips, etc.., maybe for ffi it’s just more convenient to have just string and numbers. - A
value
can be anumber
,string
,boolean
or anenum
. - A
value
can also be a list of any of the previous types, separated by adelimiter
. - A
value
can also be of acustom
type that will be treated as astring
and latter parsed by acustom
parser in the target language liketypescript
orpython
.
Features
- Support auto adding,
no-x
variants of ax
boolean flag and vis e versa. - Auto generated beautiful
help
menu. - Autogenerated completions for most mainstream shells. (low priority).