Not 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. <a href="https:&#x2F;&#x2F;github.com&#x2F;docopt&#x2F;docopt.c" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;docopt&#x2F;docopt.c</a>