[
https://issues.apache.org/jira/browse/CLI-51?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497928
]
Henri Yandell commented on CLI-51:
----------------------------------
Patch format looks great - I'll aim to apply it later today.
> [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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]