Clad User Manual - Concepts

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Default Command

An application may not have a default command. In this case, the ApplicationRuntime implementation of public String getDefaultCommand() must return null.

Options

The options (global or specific to a certain command) use the GNU command line option syntax:

 -o <value> | --option=<value>

Global Options

The global options apply to the application runtime, and they are not specific to a certain command.

Universal Global Options

All clad-based application support automatically the following global options:

-v|--verbose

-v or --verbose turn on DEBUG on the underlying CONSOLE appender, so the application will display internal execution information at stdout. In order to be displayed in this mode, the internal execution information must be logged by the application with SLFJ4 debug() call.

--debug

TODO: do I need support for -d?

Command Options

Error Handling

If a processing error is caused by what the user did, or by the input data, and it can be corrected by user input (or by data correction), throw an UserErrorException with a human-readable message. The upmost runtime layer must be designed so it displays the error message at stderr and System.exit()s.

Configuration File

Each command line option has a configuration file correspondent. Command line value takes precedence over the configuration file value.