3 ms·
One word: docopt.
by cbsmith 11y ago
One word: docopt.
- ams6110 11y agoNot sure why you were downvoted. This is the way to go IMO. Declare your options like writing a man page. Let docopt generate your option handling code. There is an implementation for C. https://github.com/docopt/docopt.c https://github.com/docopt/docopt.c
- thechao 11y agoThat's a generator for docopt parsers, written in python, targeting C. The closest docopt (variant) in C that I know of is the one I wrote: https://github.com/jaroslov/docoptc https://github.com/jaroslov/docoptc . Although, at best, I'd say that code is "looking for a maintainer".
- cbsmith 11y agoThere is a decent C++ one. What's wrong with the C people? Heck, they live and die by parsers.