The Jakarta Commons CLI library provides an API for processing command line interfaces.
CLI1 was formed by the merger of ideas and code from three different libraries and allows most simple interfaces to be modelled. CLI1 became increasingly difficult to maintain and develop further and so CLI2 has been developed with the goals of clearer responsibilities and being more flexible. The intention is that CLI2 should be able to model a far greater selection of interfaces and do so more completely, validating as much as possible.
The redesigned CLI2 is rooted in the org.apache.commons.cli2
package and the distribution retains the org.apache.commons.cli
package so that the upgrade doesn't break old code. The CLI1 package
should be regarded as deprecated to encourage the transition to the
more flexible CLI2 framework but minor bug fixes and patches may be
accepted to ensure that CLI1 based applications continue to function as
expected.
The rest of the documentation is split into the following three sections:
The latest version of this documentation is available on the web:
The generated list of dependencies lists the libraries needed to compile and test Commons CLI. To use the precompiled distribution none of these dependancies are strictly necessary. The following is a breakdown of what is required and when:
| Library | Usage |
|---|---|
| Java 1.2 | This is the minimum java level needed to use CLI2 |
| Java 1.4 | Needed if the PreferencesCommandLine is needed |
| commons-lang | Needed if the CLI1 package is being used |
| jdepend | Needed to build and test CLI2 only |
| junit | Needed to build and test CLI1 and CLI2 |