You might be interested in docopt (
http://docopt.org/), which is a multi-language command line parser that removes almost all of the boiler plate. Whereas the versions of docopts for Python, etc. just require an import, the C version emits C code to do the parsing. It may be worth a look!