commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27635] New: - Only long options without short option seems to be noticed
Date Fri, 12 Mar 2004 23:32:43 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27635>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27635

Only long options without short option seems to be noticed

           Summary: Only long options without short option seems to be
                    noticed
           Product: Commons
           Version: 1.0 Final
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: Major
          Priority: Other
         Component: CLI
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: rmann@latencyzero.com


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 bug 21349).

		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);

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message