commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r954846 - in /commons/proper/cli/trunk/src/java/org/apache/commons/cli: CommandLineParser.java DefaultParser.java Parser.java
Date Tue, 15 Jun 2010 12:07:21 GMT
Author: ebourg
Date: Tue Jun 15 12:07:20 2010
New Revision: 954846

URL: http://svn.apache.org/viewvc?rev=954846&view=rev
Log:
Improved the javadoc explaining the stopAtNonOption parameter

Modified:
    commons/proper/cli/trunk/src/java/org/apache/commons/cli/CommandLineParser.java
    commons/proper/cli/trunk/src/java/org/apache/commons/cli/DefaultParser.java
    commons/proper/cli/trunk/src/java/org/apache/commons/cli/Parser.java

Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli/CommandLineParser.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli/CommandLineParser.java?rev=954846&r1=954845&r2=954846&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli/CommandLineParser.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli/CommandLineParser.java Tue Jun
15 12:07:20 2010
@@ -63,8 +63,10 @@ public interface CommandLineParser
      *
      * @param options the specified Options
      * @param arguments the command line arguments
-     * @param stopAtNonOption specifies whether to continue parsing the
-     * arguments if a non option is encountered.
+     * @param stopAtNonOption if <tt>true</tt> an unrecognized argument stops
+     *     the parsing and the remaining arguments are added to the 
+     *     {@link CommandLine}s args list. If <tt>false</tt> an unrecognized
+     *     argument triggers a ParseException.
      *
      * @return the list of atomic option and value tokens
      * @throws ParseException if there are any problems encountered
@@ -79,7 +81,10 @@ public interface CommandLineParser
      * @param options the specified Options
      * @param arguments the command line arguments
      * @param properties command line option name-value pairs
-     * @param stopAtNonOption specifies whether to continue parsing the
+     * @param stopAtNonOption if <tt>true</tt> an unrecognized argument stops
+     *     the parsing and the remaining arguments are added to the 
+     *     {@link CommandLine}s args list. If <tt>false</tt> an unrecognized
+     *     argument triggers a ParseException.
      *
      * @return the list of atomic option and value tokens
      * @throws ParseException if there are any problems encountered

Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli/DefaultParser.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli/DefaultParser.java?rev=954846&r1=954845&r2=954846&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli/DefaultParser.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli/DefaultParser.java Tue Jun 15
12:07:20 2010
@@ -32,8 +32,14 @@ public class DefaultParser implements Co
 {    
     protected CommandLine cmd;
     protected Options options;
+
+    /** 
+     * Flag indicating how unrecognized tokens are handled. <tt>true</tt> to
stop
+     * the parsing and add the remaining tokens to the args list.
+     * <tt>false</tt> to throw an exception. 
+     */
     protected boolean stopAtNonOption;
-    
+
     /** The token currently processed. */
     protected String currentToken;
     
@@ -251,7 +257,7 @@ public class DefaultParser implements Co
         if (stopAtNonOption)
         {
             skipParsing = true;
-        }        
+        }
     }
 
     /**

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=954846&r1=954845&r2=954846&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 Tue Jun 15 12:07:20
2010
@@ -108,9 +108,10 @@ public abstract class Parser implements 
      *
      * @param options         the <code>Options</code>
      * @param arguments       the <code>arguments</code>
-     * @param stopAtNonOption specifies whether to stop interpreting the
-     *                        arguments when a non option has been encountered
-     *                        and to add them to the CommandLines args list.
+     * @param stopAtNonOption if <tt>true</tt> an unrecognized argument stops
+     *     the parsing and the remaining arguments are added to the 
+     *     {@link CommandLine}s args list. If <tt>false</tt> an unrecognized
+     *     argument triggers a ParseException.
      * @return the <code>CommandLine</code>
      * @throws ParseException if an error occurs when parsing the arguments.
      */
@@ -126,8 +127,10 @@ public abstract class Parser implements 
      * @param options the specified Options
      * @param arguments the command line arguments
      * @param properties command line option name-value pairs
-     * @param stopAtNonOption stop parsing the arguments when the first
-     * non option is encountered.
+     * @param stopAtNonOption if <tt>true</tt> an unrecognized argument stops
+     *     the parsing and the remaining arguments are added to the 
+     *     {@link CommandLine}s args list. If <tt>false</tt> an unrecognized
+     *     argument triggers a ParseException.
      *
      * @return the list of atomic option and value tokens
      *



Mime
View raw message