Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.4
-
Fix Version/s: 1.5.5, 1.6-beta-1
-
Component/s: None
-
Labels:None
-
Environment:Windows XP, Java 1.5.0_12-b04
-
Number of attachments :
Description
A coworker has found a regression since 1.5.1 with the CLIBuilder.
He is trying to get the CLIParser to read a "-s loc" parameter. It works with Groovy 1.5.1, but it does not work with 1.5.4 or the current 1.6 snapshot jar.
Here is how to reproduce the problem.
First put commons-cli-1.1.jar in {user.home}/.groovy/lib. Then remove the commons-cli-1.0.jar in the groovy installation.
Then:
C:\>set GROOVY_HOME=c:\java\groovy-1.5.1 C:\>set PATH=%GROOVY_HOME%\bin;%PATH% C:\>groovy -version Groovy Version: 1.5.1 JVM: 1.5.0_12-b04 C:\> C:\> C:\>groovy -e "def cli = new CliBuilder( usage: 'groovy' ); cli.s(longOpt: 'loc', required: true, args: 1, ''); cli.parse(['-s', 'blah'] as String[])" C:\> C:\> C:\> C:\> C:\>set GROOVY_HOME=c:\java\groovy-1.5.4 C:\>set PATH=%GROOVY_HOME%\bin;%PATH% C:\>groovy -version Groovy Version: 1.5.4 JVM: 1.5.0_12-b04 C:\>groovy -e "def cli = new CliBuilder( usage: 'groovy' ); cli.s(longOpt: 'loc', required: true, args: 1, ''); cli.parse(['-s', 'blah'] as String[])" error: Missing required option: s usage: groovy -s,--loc <arg> C:\>
This also does not work with commons-cli-1.0.jar and Groovy 1.5.4 (but it does work with Groovy 1.5.1 and cli-1.0):
C:\>groovy -e "def cli = new CliBuilder( usage: 'groovy' ); cli.s(longOpt: 'loc', required: true, args: 1, ''); cli.parse(['-s', 'blah'] as String[])" error: -s usage: groovy -s,--loc C:\>
add code tags