commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Egge (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CLI-51) [cli] Parameter value "-something" misinterpreted as a parameter
Date Tue, 15 May 2007 13:02:16 GMT

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

Brian Egge updated CLI-51:
--------------------------

    Attachment: CL51.patch

Updated patch.  Removed incorrect license header; removed formatting changed; reverted access
level change.

> [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, 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