commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CLI-51) [cli] Parameter value "-something" misinterpreted as a parameter
Date Mon, 14 May 2007 23:42:16 GMT

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

Henri Yandell commented on CLI-51:
----------------------------------

Thanks for the patch Brian; could you repeat it without the automatic IDE refactoring? It
makes it a lot harder to read the patch; and more importantly for people to look back at the
changes and see what the actual change was.

Changing from protected to private for burstToken is also often a tricky one to do as we're
stuck in the wonderful world of maintaining backwards compatibility.

The unit test looks good, but it'll need an Apache license and not an LGPL license (copy the
header from the BugCLI18Test class). 

> [cli] Parameter value "-something" misinterpreted as a parameter
> ----------------------------------------------------------------
>
>                 Key: CLI-51
>                 URL: https://issues.apache.org/jira/browse/CLI-51
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: Nightly Builds
>         Environment: Operating System: Windows NT
> Platform: PC
>            Reporter: Nigel King
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: CL51.patch
>
>
> If a parameter value is passed that contains a hyphen as the (delimited) first 
> character, CLI parses this a parameter. For example using the call
> java myclass -t "-something"
> Results in the parser creating the invalid parameter -o (noting that it is 
> skipping the 's')
> My code is using the Posix parser as follows
> Options options = buildCommandLineOptions();
> CommandLineParser parser = new PosixParser();
> CommandLine commandLine = null;
> try {
> 			
> 	commandLine = parser.parse(options, args);
> }
> catch (ParseException e) {
> 			
> 	System.out.println("Invalid parameters. " + e.getMessage() + NEW_LINE);
> 	System.exit(EXIT_CODE_ERROR);
> }
> This has been tested against the nightly build dated 20050503.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message