Command Line Modifiers

The modifiers are constants in the dfh.cli.Cli.Mod enum. They modify the command line argument parser generated by the specification. Currently there are only two modifiers:

NO_HELP

Normally the command line parser automatically adds a --help option. The NO_HELP modifier prevents this.

SHH

This prevents the addition of any of the automatically generated text to option usage information: no marking of repeatability or restrictions and so forth.

THROW_EXCEPTION

This modifier is unlikely to be of any use outside unit testing. It causes the Cli object to throw an error where it would otherwise call System.exit(int) . In unit testing this is useful for examining usage output and confirming validation exceptions are thrown appropriately. It can be useful as well if you want to wrap what is otherwise a command line application in a service or some larger application. The error messages and usage text which would normally be printed to STDERR will instead be delivered as the message of the error thrown. This error will be a RuntimeException , so you will not be forced to catch it by the compiler.