Details
Description
I created the same Option using DefaultOption and DefaultOptionBuilder but
they behave differently for short (and I am guessing for long as well)
prefixes. With DefaultOptionBuilder, the preferredName for an Option
becomes "shortPrefix" + "shortName". With DefaultOption, the preferredName
remains the "preferredName" supplied in the constructor, when I think it
should become "shortPrefix"/"longPrefix" + "preferredName"
For example:
DefaultOption optionName =
new DefaultOption(
"-",
"--",
false,
"n",
"Print greeting",
null,
null,
true,
null,
null,
'n');
When used on the command line, it will require "MyApplication n" instead
of "MyApplication -n".
The same created using the builder:
DefaultOptionBuilder oBuilder = new DefaultOptionBuilder();
Option optionName =
oBuilder
.withShortName("n")
.withDescription("Print standard greeting")
.create();
will require "MyApplication -n" and not "MyApplication n" which would be the
expected behaviour.
–
Vikram