I've finished implementing a command-line utility that parses arguments via getopt_long. To wrap things up, I need to implement a -h or --help switch that will print out the list of arguments as well as descriptions and default values.
Is there a GNU framework that I can utilize for this? If not, I realize that there are several ways I can do this manually. What's generally seen as the best approach?
You can use
See
man 3 getopt_long
on how to use it.And on what to print in the output of your
--help option
, you can readhttp://www.gnu.org/prep/standards/standards.html#g_t_002d_002dhelp