Option Processor Factory
An OptionProcessorFactory enables a client to dynamically specify and assemble an option processor. In particular, the factory allows a client to flexibly define a particular option processor while ignoring specification and evaluation order dependency. Validation is postponed until final assembly time, at which time a [ValidationException] will be thrown in the event of incorrect or incomplete specification; otherwise, the constructed option processor provably reflects the client specification.
Author
Todd L Smith
Parameters
The type of the option.
The type of option keys.
Types
An optional parameter when defining an option or optionWithArgument, to indicate how many occurrences of the option are permitted/required. For more precise control, the option body can use OptionProcessor.checkEncountered during processing, or define a rule.
A helper class to make option bodies more directly expressible.
A helper class to make bodies of options with arguments more directly expressible.
Functions
Add the default option, which is what to do with bare arguments that have no argument-requiring option preceding them.
Add the default help option, bound to '-?'. After the preamble, it outputs the keywords and description for each option.
Declare a generic option that takes no argument.
Declare a generic option that takes an argument.
Add a rule. All rules run, in the order in which they were defined via this method. If a rule discovers an invalid combination of options and arguments, it should throw a suitable OptionProcessingException whose message text is the ruleText, which will be reported to the user.