You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2006/07/10 08:31:31 UTC

[jira] Updated: (CLI-51) [cli] Parameter value "-something" misinterpreted as a parameter

     [ http://issues.apache.org/jira/browse/CLI-51?page=all ]

Henri Yandell updated CLI-51:
-----------------------------

    Bugzilla Id:   (was: 34831)
    Fix Version: 1.1

> [cli] Parameter value "-something" misinterpreted as a parameter
> ----------------------------------------------------------------
>
>          Key: CLI-51
>          URL: http://issues.apache.org/jira/browse/CLI-51
>      Project: Commons CLI
>         Type: Bug

>     Versions: Nightly Builds
>  Environment: Operating System: Windows NT
> Platform: PC
>     Reporter: Nigel King
>     Priority: Critical
>      Fix For: 1.1

>
> 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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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