Issue Details (XML | Word | Printable)

Key: CLI-26
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Rick Mann
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons CLI

[cli] Only long options without short option seems to be noticed

Created: 13/Mar/04 07:32 AM   Updated: 15/Mar/07 04:49 PM
Return to search
Component/s: CLI-1.x
Affects Version/s: 1.0
Fix Version/s: 1.1

Time Tracking:
Not Specified

Environment:
Operating System: All
Platform: Macintosh

Bugzilla Id: 27635


 Description  « Hide
I've got the following code. The only long option that seems to be noticed after parsing (PosixParser) is
the one (kOptionConfigFile) that does not have a short option. However, long options without short
options are ignored by help (except the last one. See COM-690).

Option help = new Option("h", kOptionHelp, false, "print this message");
Option version = new Option("v", kOptionVersion, false, "print version information");
Option newRun = new Option("n", kOptionNew, false, "Create NLT cache entries only for new
items");
Option trackerRun = new Option("t", kOptionTracker, false, "Create NLT cache entries only
for tracker items");

Option timeLimit = OptionBuilder.withLongOpt(kOptionTimeLimit)
.hasArg()
.withValueSeparator()
.withDescription("Set time limit for execution, in
mintues")
.create("l");

Option age = OptionBuilder.withLongOpt(kOptionAge)
.hasArg()
.withValueSeparator()
.withDescription("Age (in days) of cache item
before being recomputed")
.create("a");

Option server = OptionBuilder.withLongOpt(kOptionNLTServer)
.hasArg()
.withValueSeparator()
.withDescription("The NLT server address")
.create("s");

Option numResults = OptionBuilder.withLongOpt(kOptionNumResults)
.hasArg()
.withValueSeparator()
.withDescription("Number of results per item")
.create("r");

Option configFile = OptionBuilder.withLongOpt(kOptionConfigFile)
.hasArg()
.withValueSeparator()
.withDescription("Use the specified configuration
file")
.create();

mOptions = new Options();
mOptions.addOption(help);
mOptions.addOption(version);
mOptions.addOption(newRun);
mOptions.addOption(trackerRun);
mOptions.addOption(timeLimit);
mOptions.addOption(age);
mOptions.addOption(server);
mOptions.addOption(numResults);
mOptions.addOption(configFile);



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Rob Oxspring added a comment - 27/Dec/04 10:35 PM
This appears to have been fixed, added a test to BugsTest to demonstrate.

Thanks,

Rob


Henri Yandell added a comment - 10/Jul/06 01:20 PM
Guessing as to fix version.