[
https://issues.apache.org/jira/browse/CLI-218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Neidhart resolved CLI-218.
---------------------------------
Resolution: Fixed
Fix Version/s: 1.3
In r1444365 a clarification has been added to the javadoc of
CommandLine.getOptionValue methods.
To retrieve all specified arguments for an option, use the
CommandLine.getOptionValues() method, which returns an array of all specified
arguments.
> Add function similar to getOptionValue() that returns last value
> ----------------------------------------------------------------
>
> Key: CLI-218
> URL: https://issues.apache.org/jira/browse/CLI-218
> Project: Commons CLI
> Issue Type: New Feature
> Components: CLI-1.x
> Affects Versions: 1.2
> Reporter: Sven
> Fix For: 1.3
>
>
> Often, you can invoke command with the same option multiple time. For example
> java -cp test1 -cp test2
> even though the option only accepts one value.
> I believe, that the majority of programs then use the last value (test2 in
> this case).
> However, getOptionValue() return the first value for some weired reason.
> I believe, you should add a function called getLastOptionValue() (in class
> CommandLine) and getLastValue() (in class Option) to allow easy access to the
> last value.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira