You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/11/26 16:00:57 UTC

DO NOT REPLY [Bug 25018] New: - CommandLine getArgList() serves no options but args, only

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25018>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25018

CommandLine getArgList() serves no options but args, only

           Summary: CommandLine getArgList() serves no options but args,
                    only
           Product: Commons
           Version: 1.0 Final
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: CLI
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: kriegstdu@web.de


If i have some options set and want to know if the user specified some options 
which i do not support, i use method getArgList of CommandLine instance to 
retrieve those unsupported or unparsed options.
Javadoc says: <i>Retrieve any left-over non-recognized options and 
arguments.</i>

If i do so, i do get the args of the unparsed options, only.
I do not get the options of that args.
For example:
The following commandline is given:
-u paul -i id1 -i id2 -v -K XXX1 -L XXXXX2 -P
options -K, -L and -P are unknown as the usage shows:
usage: CliExample
 -f,--id-file <id-filename>   filename specifying ids
 -h,--help                    show help
 -i,--id <id>                 id to manipulate
 -u,--user <username>         username to login
 -v,--verbose                 be more verbose

but getArgList shows XXX1 and XXXXX2, only.
There is no way to get the unparsed options -K, -L and -P.
<b>If the user specifies unsupported options without any arguments (as option -
P in this example), there is no chance to find those boolean unsupported 
options.</b>

I suggest to either add two methods:
Option[]getNotRecognizedOptions() and 
List getNotRecognizedOptionList()
or to fix 
getArgList() and getArgs() to perform as Javadoc suggests.

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