Option Parsing On a Budget
Recently I was writing a little code generation utility which took lots of
positional arguments. I wanted to add two optional features to this utility,
these options would take no arguments. I decided to use getopt
but realised
that this would make the code depend on POSIX, I liked the idea of staying
dependency free so I quickly investigated really simple solutions for option
parsing (without compromises) which would be equivalent to POSIX and GNU
getopt
.