Clad User Manual - Concepts: Difference between revisions
Line 20: | Line 20: | ||
===Universal Global Options=== | ===Universal Global Options=== | ||
All clad-based application support automatically the following global options: | |||
====-v|--verbose==== | ====-v|--verbose==== |
Revision as of 18:24, 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
All clad-based application support automatically the following 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.