[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Here is a feature comparison of AutoOpts and six other command line parser generators. Nearly all of them share these characteristics:
The 7 parsers compared are:
getopts_long()
to parse the command line options.
Feature \ Package # | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
shell script app | YES | no | no | no | no | no | no |
Scheme app | YES | no | no | no | no | no | no |
Perl app | no | no | no | no | no | YES | no |
config file input | yes | no | no | yes | no | yes | yes |
environment input | YES | no | no | no | no | YES | no |
config file output | YES | no | no | no | no | no | no |
callback functions | yes | NO | yes | yes | yes | yes | NO |
multiple occurrence | YES | YES | no | no | no | no | no |
parameter types | [1] | 4 | 5 | 5 | 11 | [3] | 4 |
enumeration opts | YES | no | no | no | no | no | no |
optional argument | YES | YES | no | no | no | no | no |
default values | yes | yes | yes | yes | NO | yes | yes |
interactive | no | no | no | no | no | YES | no |
range checks | yes | yes | yes | no | no | no | no |
consistency checks | YES | no | no | no | no | no | no |
standard opts | YES | no | no | no | no | no | no |
man page | YES | YES | no | no | no | no | no |
texinfo invoking | YES | no | no | no | no | no | no |
developer dependencies | Guile | tcl | none | none | none | none | bison,flex |
user dependencies | [2] | none | none | none | none | none | none |
"multiple occurrence" options may appear multiple times on the command line. Some of the parsers constrain options to appearing once only.
"optional argument" refers to the argument to an option. POSIX and most command line parsers require an option to either not have an argument or else the argument must be supplied on the command line. GNU's getopt_long and some of these parsers support the notion of letting the option argument be "optional".
"consistency checks" verify that conflicting options do not appear together, and options that require other options are allowed only if those other options are present.
"standard options" are pre-defined options that can be trivially incorporated into a user's set of options. They can also thereby be used for standardizing on the flag character and option name.
"interactive" means that the option processing package is able to interactively query the user for option state.
[1] See the list of features, 8.4.2.6 Option Argument Specification.
[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 (libopts11, at present). The Guile library is now generally pre-installed on all GNU/Linux systems.
[3] opt
supports a different argument type for each fundamental
type, plus booleans, inverted booleans, toggling options and a couple
others.
-- James R. Van Zandt
-- Bruce Korb
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |