clingon
is a command-line option parsing library for Common Lisp. Its features include:
Support for subcommands
Support for command aliases
Support for short and long options
Related options may be grouped into categories
Short options may be collapsed into a single argument, as in
-xyz
Long options support the notations
--long-opt arg
and--long-opt=arg
Automatic generation of help/usage information for commands and subcommands
Out-of-the-box support for
--version
and--help
Support for various kinds of options including string, integer, boolean, switch, enum, list, counter, filepath, etc.
Subcommands can look up global options defined in parent commands
Support for required options
Options can be initialized via environment variables
Single interface for creating options using
CLINGON:MAKE-OPTION
Generate documentation for your command-line application
Support for
pre-hook
andpost-hook
actions for commands, which allow invoking functions before and after the respective handler of the command is executedSupport for Bash and Zsh completions
Extensibility, so if you don't find something you need you can extend it by developing a new option kind, or even a new mechanism for initializing options, e.g., by looking up an external key/value store