Clad User Manual - Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 34: Line 34:


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.
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.

Revision as of 18:16, 8 November 2016

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

-v|--verbose

-v or --verbose turns on DEBUG on the underlying CONSOLE appender.

--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.