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

Benedikt Ritter commented on CLI-253:
-------------------------------------

Changing the test to use DefaultParser fixes the problem. Please use 
DefaultParser instead of PosixParser.

> Unrecognized option: --null
> ---------------------------
>
>                 Key: CLI-253
>                 URL: https://issues.apache.org/jira/browse/CLI-253
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: 1.3, 1.3.1
>            Reporter: Michal Srb
>            Assignee: Benedikt Ritter
>
> groovy project uses commons-cli in following way:
>       
> {code:java}
> options.addOption(OptionBuilder.hasArg().withArgName("path").withDescription("Specify
>  where to find the class files - must be first 
> argument").create("classpath"));
> options.addOption(OptionBuilder.withLongOpt("classpath").hasArg().withArgName("path").withDescription("Aliases
>  for '-classpath'").create("cp"));
> {code}
> https://github.com/groovy/groovy-core/blob/GROOVY_1_8_X/src/main/org/codehaus/groovy/tools/FileSystemCompiler.java#L297-L298
> When called with long option "--classpath ...", it throws exception:
> org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: 
> --null
> Same code works fine with commons-cli 1.2.



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

Reply via email to