Parsing of the single-character option command line with Config class has three distinct phases:
The Config class has not been designed with concern in thread safety, but by principle only the two first phases are thread-unsafe. From that time on, the obtained values are read-only, so using it simultaneously from several threads is possible.
1. Instantiation **
The Config class provides two different constructors. Both of them require the option string as the first argument. The standard constructor Config(String) uses the default error handler.
The two-argument constructor Config(String, ErrorHandler) allows assignment of an alternate error handler just at the moment of instantiation, which ensures that even syntax errors found during the initialization phase when the option string is analyzed are routed through the that alternate error handler. That error handler is subsequently used in all operations of the parser as if set using setHandler() method.
2. Parsing command line arguments
An initialized instance of Config accepts the String[] with command line arguments as an argument to the parseArguments() method.
The mentioned method scans sequentially the array and switches on the options it has seen, eventually collecting their mandatory and/or optional argument values, and gathering the non-optional arguments. The method returns true when all used options requiring an argument value have been found to have at least one argument value specified.
Note that any option can be specified multiple times: while it does not have any effect on boolean options, for options with an argument value this results in the option having multiple argument values. For example, if your program specifies options "a🅱️", then parsing the command line
program -a one -b two -a three -b four
will yield both options 'a' and 'b' switched on and the getOptionArgs() for option 'a' shall yield *String[] {"one", "three"} and for option 'b' String[] {"two", "four"}. See Option String page for details.
3. Querying parsed values **
There are generally three types of queries issued to Config instances that should