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 a number, string, boolean or an enum.
  • A value can also be a list of any of the previous types, separated by a delimiter.
  • A value can also be of a custom type that will be treated as a string and latter parsed by a custom parser in the target language like typescript or python.

Features

  • Support auto adding, no-x variants of a x boolean flag and vis e versa.
  • Auto generated beautiful help menu.
  • Autogenerated completions for most mainstream shells. (low priority).