A library to provide two different methods of incorporating command line arguments into an application:
--help; andThe terms CLIC and CLC can be used interchangeably and mean the same thing: command line configuration.
Under the hood the project uses Apache commons-cli to parse command line
arguments. Supported properties implementations are java.util.Properties and
org.apache.commons.configuration2.PropertiesConfiguration.
In more detail, the API enables properties-based and configuration-based methods to utilise command line arguments for any given application:
Loading of properties files and convert them into command line arguments, enabling rapid prototyping of new (and existing) applications. In turn any command line arguments supplied will be used to override the property that the command line switch represents. Callers provide at least one properties file and the properties are then parsed into a valid CLC file. Once parsed, all command line switches that are supplied on the command line override the properties that have been read in. Using the API it is possible to convert properties to different types other than strings such as booleans, integer and floating point types. In addition custom CLC entries can be inserted using an overrides file to further customise properties on an individual basis; and
Provides the CLC format for defining a configuration that is used to define command line options and arguments as well as commands; all that's needed is to create a custom CLC format file for use within an application and to write required listeners to be informed of updates as command line arguments are processed.
The CLC format can be packaged directly into the application and code written to load the CLC at application start. All that's required (when not using properties, outlined above) is to write a listener class to receive updated options from the CLC as it loads and command line arguments are passed to it. Callers can then simply access the listener to get the values of the arguments once they've been processed.
In both cases, CLC offers some of the following benefits (the rest are outlined in the main CLC format section, below):
git command: for
example, diff, checkout, branch, stash and status (among many
others) are examples of commands that git provides that each have their
own unique command line options. The git stash command has many other
sub-commands - such as list, drop, apply etc - which the CLC API deems
nested commands.