GNU gengetopt takes a simple description of arguments and generates a C function that uses the GNU getopt_long(3) function to parse and validate the options. It is perfect if you are too lazy to write all that is required to call getopt_long(3), or need to use many options. The generated code also works with autoconf or automake.
|Tags||Software Development Utilities|
|Operating Systems||OS Independent|
Release Notes: A compilation problem in Mac OS X has been fixed. The versiontext directive has been added. The commandline option --strict-hidden has been added. Many bugs have been fixed.
Release Notes: Wrapping and preprocessing of strings is correctly handled. Enum variables are initialized with a generated null value (this makes the parser compilable in C++). Warnings in the generated parser when only flags are used are now removed.
Release Notes: This release has switched to using a git repository. Other gcc compilation warnings on generated files were removed.
Release Notes: Enum option values can now contain + and -. Compilation problems due to the FIX_UNUSED macro not being in the right place were fixed. --header-output-dir and --src_output-dir command line options were added to store cmdline.h separately from cmdline.c. Generated functions use prototypes with char ** instead of char *const *.
Release Notes: Further compilation warnings for generated files were removed. A compilation problem for files generated with --include-getopt with some versions of stdlib.h was fixed. The dependency on the flex library (which generated problems in compilation in Open Solaris) was removed. PACKAGE_NAME, if defined, is used for printing help and version. The configure option --docdir is now used, if specified for installing documentation.