commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Bourg (JIRA)" <j...@apache.org>
Subject [jira] Created: (CLI-161) PosixParser doesn't stop the parsing on "--" tokens following an option with an argument
Date Fri, 25 Jul 2008 09:55:31 GMT
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.


Mime
View raw message