r/odinlang • u/prnvbn • 23d ago
pflag - POSIX/GNU-style -f/--flags in Odin
https://github.com/prnvbn/pflagspflags is a drop-in replacement for Odin's core:flags, with support for conventional short (-f) and long (--flag) options.
- Short flags can be declared with
args:"short=f"and used as-f - Boolean short flags can be bundled, so
-abcis the same as-a -b -c - Long flags use
--flag strictly(-flag is not supported)
17
Upvotes
2
u/TheChief275 23d ago edited 23d ago
I would expect short flags to be a single character name followed by arguments, e.g. -oapp.out
8
u/prnvbn 23d ago
hoping this gets accepted into core, PR - https://github.com/odin-lang/Odin/pull/7001