commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLI-252) LongOpt falsely detected as ambiguous
Date Mon, 01 Jun 2015 15:23:24 GMT

    [ https://issues.apache.org/jira/browse/CLI-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14567423#comment-14567423
] 

ASF GitHub Bot commented on CLI-252:
------------------------------------

GitHub user simonharrer opened a pull request:

    https://github.com/apache/commons-cli/pull/2

    Fixes CLI-252 exact matches are not ambiquous

    https://issues.apache.org/jira/browse/CLI-252

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/simonharrer/commons-cli fix-CLI-252

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-cli/pull/2.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2
    
----

----


> LongOpt falsely detected as ambiguous
> -------------------------------------
>
>                 Key: CLI-252
>                 URL: https://issues.apache.org/jira/browse/CLI-252
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: Parser
>    Affects Versions: 1.3
>         Environment: Windows 7, JDK 1.8.0v45
>            Reporter: Simon Harrer
>             Fix For: 1.4
>
>
> Options options = new Options();
> options.addOption(Option.builder().longOpt("importToOpen").hasArg().argName("FILE").build());
> options.addOption(Option.builder("i").longOpt("import").hasArg().argName("FILE").build());
> Parsing "--import=FILE" is not possible since 1.3 as it throws a AmbiguousOptionException
stating that it cannot decide whether import is import or importToOpen. In 1.2 this is not
an issue. 
> The root lies in the new DefaultParser which does a startsWith check internally. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message