POSIX has getopt , glibc adds getopt_long . Both of the links I posted have examples. None of them parse the environment variables of the XML / INI files, but the two do not relate to parsing command-line options. Quick google search results in libraries to be able to do all this.
source share