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 36997] New: - CommandLine.getOptionValue() behaves contrary to docs
Date Mon, 10 Oct 2005 17:06:12 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=36997>.
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=36997

           Summary: CommandLine.getOptionValue() behaves contrary to docs
           Product: Commons
           Version: 1.0 Final
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: CLI
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: junk5@microserf.org.uk


Hi

If I have:

final String debugOpt = "debug";
	Option debug = OptionBuilder
	    .withArgName(debugOpt)
	    .withDescription("turn on debugging")
	    .withLongOpt(debugOpt)
	    .create('d');

and then later I do:

String dbg = commandLine.getOptionValue(debugOpt);

then dbg will be null. Instead, I have to use getOptionValue('d'). This seems
contrary to the docs (see bottom of
http://jakarta.apache.org/commons/cli/usage.html), which implies that I should
be able to query the commandLine object using a full string, rather than just
the string's first character.

Can I suggest that the API of OptionBuilder be made clearer so that it is
obvious that you can have long and short option names---perhaps make the
create() method take no arguments (thus forcing long and short arg names to be
set explicitly). (Also, there seems to be some confusion between the terms
'argument' and 'option' in the API, but perhaps that is just me).

Also, I would hop to be able to query commandLine by either a single char or an
entire string, as suggested by the docs.

Thanks,

Chris

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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