cmdparse

… is an advanced Ruby command line parser supporting nested commands.

It allows the creation of “command style” programs, like git or svn, that perform different
functions depending on which command is invoked. Additionally, nesting of commands, i.e. commands
that take commands themselves, is also possible. For option parsing, the battle-tested Ruby standard
library optparse is used.

A typical command line for a program which uses commands looks like this:

$ net --verbose ipaddr add 192.168.0.1 193.150.0.1

Features

Commands can have sub-commands

Built-in commands for showing help and the version of the program

Automatic discovery of names and number of required/optional command arguments

Truly global options that can be used on any command

No need to learn a special DSL

Use POROs (plain old Ruby objects) for creating commands or create them on the fly