Clad User Manual - Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 29: Line 29:
====-d|--debug====
====-d|--debug====


<tt>-d</tt> or <tt>--debug</tt>, in addition to logging debug information at the CONSOLE the way -v|--verbose options do, start the underlying JVM in debug mode, so a debugger can be attached to it.
<tt>-d</tt> or <tt>--debug</tt>, in addition to logging debug information at the CONSOLE the way [[Clad_User_Manual_-_Concepts#-v.7C--verbose|-v|--verbose]] options do, start the underlying JVM in debug mode, so a debugger can be attached to it.


==Command Options==
==Command Options==

Revision as of 18:48, 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 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() method.

-d|--debug

-d or --debug, in addition to logging debug information at the CONSOLE the way -v|--verbose options do, start the underlying JVM in debug mode, so a debugger can be attached to it.

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.