Low commit activity in last 3 years
A long-lived project that still receives updates
cmdparse provides classes for parsing (possibly nested) commands on the command line; command line options themselves are parsed using optparse.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
 Project Readme

cmdparse - an advanced command line parser using optparse which has support for commands

Copyright (C) 2004-2020 Thomas Leitner

Description

Some programs use a "command style" command line. Examples for such programs are the "gem" program from Rubygems and the "svn" program from Subversion. The standard Ruby distribution has no library to create programs that use such a command line interface.

This library, cmdparse, can be used to create such a command line interface. Internally it uses optparse to parse options and it provides a nice API for specifying commands.

See https://cmdparse.gettalong.org for detailed information, an extensive tutorial and the API reference!

Documentation

You can build the documentation by invoking

$ rake doc

This builds the whole documentation and needs webgen >=1.4.0 (https://webgen.gettalong.org) for building.

Example Usage

There is an example of how to use cmdparse in the example/net.rb file. A detailed walkthrough of what each part does can be found on https://cmdparse.gettalong.org/tutorial.html.

License

MIT - see COPYING.

Dependencies

none

Installation

The preferred way of installing cmdparse is via RubyGems:

$ gem install cmdparse

If you don't want to use RubyGems, use these commands:

$ ruby setup.rb config
$ ruby setup.rb setup
$ ruby setup.rb install

Contact

Author: Thomas Leitner