commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r955096 - in /commons/proper/cli/trunk/src: java/org/apache/commons/cli/Parser.java test/org/apache/commons/cli/ValueTest.java
Date Wed, 16 Jun 2010 00:00:14 GMT
Author: ebourg
Date: Wed Jun 16 00:00:14 2010
New Revision: 955096

URL: http://svn.apache.org/viewvc?rev=955096&view=rev
Log:
The processing of the default options is no longer stopped by a flag with a false value (CLI-201)

Modified:
    commons/proper/cli/trunk/src/java/org/apache/commons/cli/Parser.java
    commons/proper/cli/trunk/src/test/org/apache/commons/cli/ValueTest.java

Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli/Parser.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli/Parser.java?rev=955096&r1=955095&r2=955096&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli/Parser.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli/Parser.java Wed Jun 16 00:00:14
2010
@@ -287,7 +287,7 @@ public abstract class Parser implements 
                 {
                     // if the value is not yes, true or 1 then don't add the
                     // option to the CommandLine
-                    break;
+                    continue;
                 }
 
                 cmd.addOption(opt);

Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli/ValueTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli/ValueTest.java?rev=955096&r1=955095&r2=955096&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli/ValueTest.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli/ValueTest.java Wed Jun 16 00:00:14
2010
@@ -212,7 +212,7 @@ public class ValueTest extends TestCase
         cmd = parser.parse(opts, null, properties);
         assertTrue( !cmd.hasOption("a") );
         assertTrue( !cmd.hasOption("c") );
-        assertTrue( !cmd.hasOption("e") );
+        assertTrue( cmd.hasOption("e") ); // this option accepts as argument
 
 
         properties = new Properties();
@@ -233,7 +233,7 @@ public class ValueTest extends TestCase
         cmd = parser.parse(opts, null, properties);
         assertTrue( !cmd.hasOption("a") );
         assertTrue( !cmd.hasOption("c") );
-        assertTrue( !cmd.hasOption("e") );
+        assertTrue( cmd.hasOption("e") );
     } 
 
     public void testPropertyOptionMultipleValues() throws Exception



Mime
View raw message