PosixParser doesn't stop the parsing on "--" tokens following an option with an
argument
----------------------------------------------------------------------------------------
Key: CLI-161
URL: https://issues.apache.org/jira/browse/CLI-161
Project: Commons CLI
Issue Type: Bug
Components: Parser
Affects Versions: 1.0
Reporter: Emmanuel Bourg
Fix For: 1.2
PosixParser doesn't stop on "--" tokens if the option preceding the token
expects an argument. GnuParser is not affected by this issue.
Test case:
{code}
public void testDoubleHyphenToken() throws Exception
{
Options options = new Options();
options.addOption(OptionBuilder.hasArg().create('n'));
options.addOption(OptionBuilder.create('m'));
CommandLine cl = parser.parse(options, new String[] { "-n", "--", "-m" });
assertTrue(cl.hasOption("n"));
assertFalse(cl.hasOption("m"));
}
{code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.