Competitive Feature Analysis
============================

Here is a feature comparison of AutoOpts and five other command line parser generators.  They all read a file that describes the program options and produce code to parse command line options.  Each has their own format for describing options.

All versions support both short options (flags) and GNU-type long options.  clig, however, is unique in that you must choose one or the other.  Either way, clig options are introduced with a single hyphen. The other packages identify long options with doubled hyphens.

 1. AutoOpts is a component of AutoGen.  AutoGen has many capabilities, but here we concentrate on the portion called AutoOpts.  AutoOpts is the most general of these programs, and has the most extensive documentation.  It is the only one that supports shell scripts as well as C programs.  It also supports command option processing from a configuration file or the environment.

 2. clig generates a skeleton man page and can also update a previously generated man page.

 3. Little is known by me [Bruce] about genparse.

 4. gaa supports option input from a configuration file as well as the command line.  NOTE HOWEVER: gaa is not maintained.

 5. gengetopt is the only one that generates a skeleton main.c instead of a separate parsing function.  Since you must edit this file to create your program, rerunning gengetopt will wipe out any such changes.

 6. wyg uses flex and bison to generate a configuration file parser, but uses getopt_long to parse the command line options.

package
1
2
3
4
5
6
C language app
yes
yes
yes
yes
yes
yes
shell script app
yes
no
no
no
no
no
package result
parser
parser
parser
parser
main.c
parser
config file input
yes
no
no
yes
no
yes
environment input
yes
no
no
no
no
no
config file output
yes
no
no
no
no
no
command line
yes
yes
yes
yes
yes
yes
parameter types
[1]
4
5
5
11
4
callback functions
yes
no
yes
yes
yes
no
multiple parameters
yes
yes
no
no
no
no
optional parameters
yes
yes
no
no
no
no
default values
yes
yes
yes
yes
no
yes
range checks
no
yes
yes
no
no
no
enumeration options
yes
no
no
no
no
no
option data
struct
struct
struct
struct
vars
struct
usage()
yes
yes
yes
yes
yes
yes
man page
yes
yes
no
no
no
no
texinfo usage
yes
no
no
no
no
no
makefile
no
no
no
no
no
no
developer dependencies
Guile
tcl
none
none
none
bison,flex
user dependencies
[2]
none
none
none
none
none

[1] See the lengthy list of features see Features.

[2] There is a user-visible dependency iff the developer does a dynamic link to the libopts.so library.  Developers are free to either link statically or ship libopts.so with their product. A Debian package would need only a dependency on the package supplying libopts (libopts9, at present).

The Guile library is now generally pre-installed on all GNU/Linux systems.

-- James R. Van Zandt