Author: bayard
Date: Fri Mar 21 20:13:05 2008
New Revision: 639944
URL: http://svn.apache.org/viewvc?rev=639944&view=rev
Log:
Fixing the trailing whitespace with a proper regex this time
Modified:
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Argument.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/CommandLine.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/DisplaySetting.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Group.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/HelpLine.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Option.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Parent.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/WriteableCommandLine.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/builder/ArgumentBuilder.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/DefaultingCommandLine.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/Parser.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/PreferencesCommandLine.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/PropertiesCommandLine.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/ArgumentImpl.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/GroupImpl.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/HelpLineImpl.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/resource/ResourceHelper.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/util/Comparators.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/util/HelpFormatter.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/FileValidator.java
commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/Validator.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/CLITestCase.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/CommandLineDefaultsTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/DocumentationTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/WriteableCommandLineTestCase.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/application/CpTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/application/LsTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug27575Test.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug28005Test.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug32533Test.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/DefaultingCommandLineTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/PreferencesCommandLineTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/PropertiesCommandLineTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/jdepend/JDependTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/option/DefaultOptionTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/option/PropertyOptionTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/util/ComparatorsTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/validation/DateValidatorTest.java
commons/proper/cli/trunk/src/test/org/apache/commons/cli2/validation/FileValidatorTest.java
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Argument.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Argument.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Argument.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Argument.java Fri Mar 21 20:13:05 2008
@@ -27,11 +27,11 @@
/**
* Returns the initial separator character or
* '\0' if no character has been set.
- *
+ *
* @return char the initial separator character
*/
char getInitialSeparator();
-
+
/**
* Processes the "README" style element of the argument.
*
@@ -50,10 +50,10 @@
final ListIterator args,
final Option option)
throws OptionException;
-
+
/**
* Adds defaults to a CommandLine.
- *
+ *
* @param commandLine
* The CommandLine object to store defaults in.
* @param option
@@ -86,7 +86,7 @@
*
* @see #getMinimum()
* @see #getMaximum()
- * @return true iff the CommandLine will be invalid without at least one
+ * @return true iff the CommandLine will be invalid without at least one
* value
*/
boolean isRequired();
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/CommandLine.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/CommandLine.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/CommandLine.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/CommandLine.java Fri Mar 21 20:13:05 2008
@@ -24,191 +24,191 @@
* according to the definition supplied to the parser.
*/
public interface CommandLine {
-
+
/**
- * Detects the presence of an option with the specified trigger in this
+ * Detects the presence of an option with the specified trigger in this
* CommandLine.
- *
+ *
* @param trigger the trigger to search for
* @return true iff an option with this trigger is present
*/
boolean hasOption(final String trigger);
-
+
/**
* Detects the presence of an option in this CommandLine.
- *
+ *
* @param option the Option to search for
* @return true iff the option is present
*/
boolean hasOption(final Option option);
-
+
/**
* Finds the Option with the specified trigger
- *
+ *
* @param trigger the name of the option to retrieve
* @return the Option matching the trigger or null if none exists
*/
Option getOption(final String trigger);
-
+
/**
* Retrieves the Argument values associated with the specified Option
- *
+ *
* @param trigger a trigger used to lookup the Option
* @return a list of values or an empty List if none are found
*/
List getValues(final String trigger);
-
+
/**
* Retrieves the Argument values associated with the specified Option
- *
+ *
* @param trigger a trigger used to lookup the Option
* @param defaultValues the result to return if no values are found
* @return a list of values or defaultValues if none are found
*/
List getValues(final String trigger, final List defaultValues);
-
+
/**
* Retrieves the Argument values associated with the specified Option
- *
+ *
* @param option the Option associated with the values
* @return a list of values or an empty List if none are found
*/
List getValues(final Option option);
-
+
/**
* Retrieves the Argument values associated with the specified Option
- *
+ *
* @param option the Option associated with the values
* @param defaultValues the result to return if no values are found
* @return a list of values or defaultValues if none are found
*/
List getValues(final Option option, final List defaultValues);
-
+
/**
* Retrieves the single Argument value associated with the specified Option
- *
+ *
* @param trigger a trigger used to lookup the Option
* @return the matching value or null if none exists
* @throws IllegalStateException if more than one values are found
*/
Object getValue(final String trigger) throws IllegalStateException;
-
+
/**
* Retrieves the single Argument value associated with the specified Option
- *
+ *
* @param trigger a trigger used to lookup the Option
* @param defaultValue the result to use if no values are found
* @return the matching value or defaultValue if none exists
* @throws IllegalStateException if more than one values are found
*/
Object getValue(final String trigger, final Object defaultValue) throws IllegalStateException;
-
+
/**
* Retrieves the single Argument value associated with the specified Option
- *
+ *
* @param option the Option associated with the value
* @return the matching value or null if none exists
* @throws IllegalStateException if more than one values are found
*/
Object getValue(final Option option) throws IllegalStateException;
-
+
/**
* Retrieves the single Argument value associated with the specified Option
- *
+ *
* @param option the Option associated with the value
* @param defaultValue the result to use if no values are found
* @return the matching value or defaultValue if none exists
* @throws IllegalStateException if more than one values are found
*/
Object getValue(final Option option, final Object defaultValue) throws IllegalStateException;
-
+
/**
* Retrieves the Boolean value associated with the specified Switch
- *
+ *
* @param trigger a trigger used to lookup the Option
* @return the Boolean associated with trigger or null if none exists
*/
Boolean getSwitch(final String trigger);
-
+
/**
* Retrieves the Boolean value associated with the specified Switch
- *
+ *
* @param trigger a trigger used to lookup the Option
* @param defaultValue the Boolean to use if none match
* @return the Boolean associated with trigger or defaultValue if none exists
*/
Boolean getSwitch(final String trigger, final Boolean defaultValue);
-
+
/**
* Retrieves the Boolean value associated with the specified Switch
- *
+ *
* @param option the Option associated with the value
* @return the Boolean associated with option or null if none exists
*/
Boolean getSwitch(final Option option);
-
+
/**
* Retrieves the Boolean value associated with the specified Switch
- *
+ *
* @param option the Option associated with the value
* @param defaultValue the Boolean to use if none match
* @return the Boolean associated with option or defaultValue if none exists
*/
Boolean getSwitch(final Option option, final Boolean defaultValue);
-
-
+
+
/**
- * Retrieves the value associated with the specified property
- *
+ * Retrieves the value associated with the specified property
+ *
* @param property the property name to lookup
* @return the value of the property or null
*/
String getProperty(final String property);
-
+
/**
- * Retrieves the value associated with the specified property
- *
+ * Retrieves the value associated with the specified property
+ *
* @param property the property name to lookup
* @param defaultValue the value to use if no other is found
* @return the value of the property or defaultValue
*/
String getProperty(final String property, final String defaultValue);
-
+
/**
* Retrieves the set of all property names associated with this CommandLine
- *
- * @return a none null set of property names
+ *
+ * @return a none null set of property names
*/
Set getProperties();
-
+
/**
- * Retrieves the number of times the specified Option appeared in this
+ * Retrieves the number of times the specified Option appeared in this
* CommandLine
- *
+ *
* @param trigger a trigger used to lookup the Option
* @return the number of occurrences of the option
*/
int getOptionCount(final String trigger);
-
+
/**
- * Retrieves the number of times the specified Option appeared in this
+ * Retrieves the number of times the specified Option appeared in this
* CommandLine
- *
+ *
* @param option the Option associated to check
* @return the number of occurrences of the option
*/
int getOptionCount(final Option option);
-
+
/**
* Retrieves a list of all Options found in this CommandLine
- *
+ *
* @return a none null list of Options
*/
List getOptions();
-
+
/**
* Retrieves a list of all Option triggers found in this CommandLine
- *
+ *
* @return a none null list of Option triggers
*/
Set getOptionTriggers();
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/DisplaySetting.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/DisplaySetting.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/DisplaySetting.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/DisplaySetting.java Fri Mar 21 20:13:05 2008
@@ -27,102 +27,102 @@
* will be passed to a method that will lookup the presence of the values.
*/
public class DisplaySetting {
-
+
private static final Set all = new HashSet();
/**
* A Set guarenteed to contain all possible DisplaySetting values
*/
public static final Set ALL = Collections.unmodifiableSet(all);
-
+
/**
* A Set guarenteed to contain no DisplaySetting values
*/
public static final Set NONE = Collections.EMPTY_SET;
-
+
/**
* Indicates that aliases should be included
*/
public static final DisplaySetting DISPLAY_ALIASES =
new DisplaySetting("DISPLAY_ALIASES");
-
+
/**
* Indicates that optionality should be included
*/
public static final DisplaySetting DISPLAY_OPTIONAL =
new DisplaySetting("DISPLAY_OPTIONAL");
-
+
/**
* Indicates that property options should be included
*/
public static final DisplaySetting DISPLAY_PROPERTY_OPTION =
new DisplaySetting("DISPLAY_PROPERTY_OPTION");
-
+
/**
* Indicates that switches should be included enabled
*/
public static final DisplaySetting DISPLAY_SWITCH_ENABLED =
new DisplaySetting("DISPLAY_SWITCH_ENABLED");
-
+
/**
* Indicates that switches should be included disabled
*/
public static final DisplaySetting DISPLAY_SWITCH_DISABLED =
new DisplaySetting("DISPLAY_SWITCH_DISABLED");
-
+
/**
* Indicates that group names should be included
*/
public static final DisplaySetting DISPLAY_GROUP_NAME =
new DisplaySetting("DISPLAY_GROUP_NAME");
-
+
/**
* Indicates that groups should be included expanded
*/
public static final DisplaySetting DISPLAY_GROUP_EXPANDED =
new DisplaySetting("DISPLAY_GROUP_EXPANDED");
-
+
/**
* Indicates that group arguments should be included
*/
public static final DisplaySetting DISPLAY_GROUP_ARGUMENT =
new DisplaySetting("DISPLAY_GROUP_ARGUMENT");
-
+
/**
* Indicates that group outer brackets should be included
*/
public static final DisplaySetting DISPLAY_GROUP_OUTER =
new DisplaySetting("DISPLAY_GROUP_OUTER");
-
+
/**
* Indicates that arguments should be included numbered
*/
public static final DisplaySetting DISPLAY_ARGUMENT_NUMBERED =
new DisplaySetting("DISPLAY_ARGUMENT_NUMBERED");
-
+
/**
* Indicates that arguments should be included bracketed
*/
public static final DisplaySetting DISPLAY_ARGUMENT_BRACKETED =
new DisplaySetting("DISPLAY_ARGUMENT_BRACKETED");
-
+
/**
* Indicates that arguments of Parents should be included
*/
public static final DisplaySetting DISPLAY_PARENT_ARGUMENT =
new DisplaySetting("DISPLAY_PARENT_ARGUMENT");
-
+
/**
* Indicates that children of Parents should be included
*/
public static final DisplaySetting DISPLAY_PARENT_CHILDREN =
new DisplaySetting("DISPLAY_PARENT_CHILDREN");
-
+
/**
* The name of the setting
*/
private final String name;
-
+
/**
* The hashCode of the setting
*/
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Group.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Group.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Group.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Group.java Fri Mar 21 20:13:05 2008
@@ -26,11 +26,11 @@
/**
* Appends usage information to the specified StringBuffer
- *
+ *
* @param buffer the buffer to append to
* @param helpSettings a set of display settings @see DisplaySetting
* @param comp a comparator used to sort the Options
- * @param separator the String used to separate member Options
+ * @param separator the String used to separate member Options
*/
void appendUsage(
final StringBuffer buffer,
@@ -44,7 +44,7 @@
*
* @see #getMinimum()
* @see #getMaximum()
- * @return true iff the CommandLine will be invalid without at least one
+ * @return true iff the CommandLine will be invalid without at least one
* member option
*/
boolean isRequired();
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/HelpLine.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/HelpLine.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/HelpLine.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/HelpLine.java Fri Mar 21 20:13:05 2008
@@ -42,7 +42,7 @@
/**
* Builds a usage string for the option using the specified settings and
* comparator.
- *
+ *
* @param helpSettings
* the settings to apply
* @param comparator
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Option.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Option.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Option.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Option.java Fri Mar 21 20:13:05 2008
@@ -29,12 +29,12 @@
/**
* Processes String arguments into a CommandLine.
- *
+ *
* The iterator will initially point at the first argument to be processed
* and at the end of the method should point to the first argument not
* processed. This method MUST process at least one argument from the
* ListIterator.
- *
+ *
* @param commandLine
* The CommandLine object to store results in
* @param args
@@ -46,13 +46,13 @@
final WriteableCommandLine commandLine,
final ListIterator args)
throws OptionException;
-
+
/**
* Adds defaults to a CommandLine.
- *
- * Any defaults for this option are applied as well as the defaults for
+ *
+ * Any defaults for this option are applied as well as the defaults for
* any contained options
- *
+ *
* @param commandLine
* The CommandLine object to store defaults in
*/
@@ -61,7 +61,7 @@
/**
* Indicates whether this Option will be able to process the particular
* argument.
- *
+ *
* @param argument
* The argument to be tested
* @return true if the argument can be processed by this Option
@@ -72,7 +72,7 @@
* Indicates whether this Option will be able to process the particular
* argument. The ListIterator must be restored to the initial state before
* returning the boolean.
- *
+ *
* @see #canProcess(WriteableCommandLine,String)
* @param arguments
* the ListIterator over String arguments
@@ -84,9 +84,9 @@
* Identifies the argument prefixes that should trigger this option. This
* is used to decide which of many Options should be tried when processing
* a given argument string.
- *
+ *
* The returned Set must not be null.
- *
+ *
* @return The set of triggers for this Option
*/
Set getTriggers();
@@ -96,9 +96,9 @@
* is used to identify whether a given string looks like an option or an
* argument value. Typically an option would return the set [--,-] while
* switches might offer [-,+].
- *
+ *
* The returned Set must not be null.
- *
+ *
* @return The set of prefixes for this Option
*/
Set getPrefixes();
@@ -106,7 +106,7 @@
/**
* Checks that the supplied CommandLine is valid with respect to this
* option.
- *
+ *
* @param commandLine
* The CommandLine to check.
* @throws OptionException
@@ -117,7 +117,7 @@
/**
* Builds up a list of HelpLineImpl instances to be presented by HelpFormatter.
- *
+ *
* @see HelpLine
* @see org.apache.commons.cli2.util.HelpFormatter
* @param depth
@@ -135,7 +135,7 @@
/**
* Appends usage information to the specified StringBuffer
- *
+ *
* @param buffer the buffer to append to
* @param helpSettings a set of display settings @see DisplaySetting
* @param comp a comparator used to sort the Options
@@ -148,7 +148,7 @@
/**
* The preferred name of an option is used for generating help and usage
* information.
- *
+ *
* @return The preferred name of the option
*/
String getPreferredName();
@@ -156,16 +156,16 @@
/**
* Returns a description of the option. This string is used to build help
* messages as in the HelpFormatter.
- *
+ *
* @see org.apache.commons.cli2.util.HelpFormatter
* @return a description of the option.
*/
String getDescription();
/**
- * Returns the id of the option. This can be used in a loop and switch
+ * Returns the id of the option. This can be used in a loop and switch
* construct:
- *
+ *
* <code>
* for(Option o : cmd.getOptions()){
* switch(o.getId()){
@@ -173,10 +173,10 @@
* ...
* }
* }
- * </code>
- *
+ * </code>
+ *
* The returned value is not guarenteed to be unique.
- *
+ *
* @return the id of the option.
*/
int getId();
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Parent.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Parent.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Parent.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/Parent.java Fri Mar 21 20:13:05 2008
@@ -19,7 +19,7 @@
import java.util.ListIterator;
/**
- * An Option that can have an argument and/or group of child Options in the form
+ * An Option that can have an argument and/or group of child Options in the form
* "-f <arg> [-a|-b|-c]".
*/
public interface Parent extends Option {
@@ -28,7 +28,7 @@
* Processes the parent part of the Option. The combination of parent,
* argument and children is handled by the process method.
* @see Option#process(WriteableCommandLine, ListIterator)
- *
+ *
* @param commandLine the CommandLine to write results to
* @param args a ListIterator over argument strings positioned at the next
* argument to process
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/WriteableCommandLine.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/WriteableCommandLine.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/WriteableCommandLine.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/WriteableCommandLine.java Fri Mar 21 20:13:05 2008
@@ -22,13 +22,13 @@
* A CommandLine that detected values and options can be written to.
*/
public interface WriteableCommandLine extends CommandLine {
-
+
/**
* Adds an Option to the CommandLine
* @param option the Option to add
*/
void addOption(final Option option);
-
+
/**
* Adds a value to an Option in the CommandLine.
* @param option the Option to add to
@@ -42,7 +42,7 @@
* @param defaultValues the defaults for the option
*/
void setDefaultValues(final Option option, final List defaultValues);
-
+
/**
* Adds a switch value to an Option in the CommandLine.
* @param option the Option to add to
@@ -50,25 +50,25 @@
* @throws IllegalStateException if the switch has already been added
*/
void addSwitch(final Option option, final boolean value) throws IllegalStateException;
-
+
/**
* Sets the default state for a Switch in the CommandLine.
* @param option the Option to add to
* @param defaultSwitch the defaults state for ths switch
*/
void setDefaultSwitch(final Option option, final Boolean defaultSwitch);
-
+
/**
* Adds a property value to a name in the CommandLine.
* Replaces any existing value for the property.
- *
+ *
* @param property the name of the property
* @param value the value of the property
*/
void addProperty(final String property, final String value);
-
+
/**
- * Detects whether the argument looks like an Option trigger
+ * Detects whether the argument looks like an Option trigger
* @param argument the argument to test
* @return true if the argument looks like an Option trigger
*/
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/builder/ArgumentBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/builder/ArgumentBuilder.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/builder/ArgumentBuilder.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/builder/ArgumentBuilder.java Fri Mar 21 20:13:05 2008
@@ -32,7 +32,7 @@
/** i18n */
private final static ResourceHelper resources = ResourceHelper.getResourceHelper();
-
+
/** name of the argument. Used for display and lookups in CommandLine */
private String name;
@@ -73,7 +73,7 @@
/**
* Creates a new Argument instance using the options specified in this
* ArgumentBuilder.
- *
+ *
* @return A new Argument instance using the options specified in this
* ArgumentBuilder.
*/
@@ -117,9 +117,9 @@
/**
* Sets the name of the argument. The name is used when displaying usage
* information and to allow lookups in the CommandLine object.
- *
+ *
* @see org.apache.commons.cli2.CommandLine#getValue(String)
- *
+ *
* @param newName the name of the argument
* @return this ArgumentBuilder
*/
@@ -136,9 +136,9 @@
/**
* Sets the description of the argument.
- *
+ *
* The description is used when displaying online help.
- *
+ *
* @param newDescription a description of the argument
* @return this ArgumentBuilder
*/
@@ -149,7 +149,7 @@
/**
* Sets the minimum number of values needed for the argument to be valid.
- *
+ *
* @param newMinimum the number of values needed
* @return this ArgumentBuilder
*/
@@ -163,7 +163,7 @@
/**
* Sets the maximum number of values allowed for the argument to be valid.
- *
+ *
* @param newMaximum the number of values allowed
* @return this ArgumentBuilder
*/
@@ -179,8 +179,8 @@
* Sets the character used to separate the values from the option. When an
* argument is of the form -libs:dir1,dir2,dir3 the initialSeparator would
* be ':'.
- *
- * @param newInitialSeparator the character used to separate the values
+ *
+ * @param newInitialSeparator the character used to separate the values
* from the option
* @return this ArgumentBuilder
*/
@@ -195,8 +195,8 @@
* Sets the character used to separate the values from each other. When an
* argument is of the form -libs:dir1,dir2,dir3 the subsequentSeparator
* would be ','.
- *
- * @param newSubsequentSeparator the character used to separate the values
+ *
+ * @param newSubsequentSeparator the character used to separate the values
* from each other
* @return this ArgumentBuilder
*/
@@ -210,7 +210,7 @@
/**
* Sets the validator instance used to perform validation on the Argument
* values.
- *
+ *
* @param newValidator a Validator instance
* @return this ArgumentBuilder
*/
@@ -225,15 +225,15 @@
/**
* Sets the "consume remaining" option, defaults to "--". Use this if you
* want to allow values that might be confused with option strings.
- *
- * @param newConsumeRemaining the string to use for the consume
+ *
+ * @param newConsumeRemaining the string to use for the consume
* remaining option
* @return this ArgumentBuilder
*/
public final ArgumentBuilder withConsumeRemaining(final String newConsumeRemaining) {
if (newConsumeRemaining == null) {
throw new IllegalArgumentException(resources.getMessage(ResourceConstants.ARGUMENT_BUILDER_NULL_CONSUME_REMAINING));
- }
+ }
if ( "".equals(newConsumeRemaining)) {
throw new IllegalArgumentException(resources.getMessage(ResourceConstants.ARGUMENT_BUILDER_EMPTY_CONSUME_REMAINING));
}
@@ -243,7 +243,7 @@
/**
* Sets the default value.
- *
+ *
* @param defaultValue the default value for the Argument
* @return this ArgumentBuilder
*/
@@ -251,7 +251,7 @@
if (defaultValue == null) {
throw new IllegalArgumentException(resources.getMessage(ResourceConstants.ARGUMENT_BUILDER_NULL_DEFAULT));
}
-
+
if (this.defaultValues == null) {
this.defaultValues = new ArrayList(1);
}
@@ -261,7 +261,7 @@
/**
* Sets the default values.
- *
+ *
* @param newDefaultValues the default values for the Argument
* @return this ArgumentBuilder
*/
@@ -275,7 +275,7 @@
/**
* Sets the id
- *
+ *
* @param newId the id of the Argument
* @return this ArgumentBuilder
*/
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/DefaultingCommandLine.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/DefaultingCommandLine.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/DefaultingCommandLine.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/DefaultingCommandLine.java Fri Mar 21 20:13:05 2008
@@ -30,10 +30,10 @@
* Manages a queue of default CommandLines. This CommandLine implementation is
* backed by a queue of CommandLine instances which are queried in turn until a
* suitable result is found.
- *
+ *
* CommandLine instances can either be added to the back of the queue or can be
* pushed in at a specific position.
- *
+ *
* @see #appendCommandLine(CommandLine)
* @see #insertCommandLine(int, CommandLine)
*/
@@ -48,17 +48,17 @@
* Adds a CommandLine instance to the back of the queue. The supplied
* CommandLine will be used as defaults when all other CommandLines produce
* no result
- *
+ *
* @param commandLine
* the default values to use if all CommandLines
*/
public void appendCommandLine(final CommandLine commandLine) {
commandLines.add(commandLine);
}
-
+
/**
* Adds a CommandLine instance to a specified position in the queue.
- *
+ *
* @param index ths position at which to insert
* @param commandLine the CommandLine to insert
*/
@@ -67,10 +67,10 @@
final CommandLine commandLine) {
commandLines.add(index, commandLine);
}
-
+
/**
* Builds an iterator over the build in CommandLines.
- *
+ *
* @return an unmodifiable iterator
*/
public Iterator commandLines(){
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/Parser.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/Parser.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/Parser.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/Parser.java Fri Mar 21 20:13:05 2008
@@ -61,7 +61,7 @@
for (int i = 0; i < arguments.length; i++) {
final String argument = arguments[i];
- // ensure non intern'd strings are used
+ // ensure non intern'd strings are used
// so that == comparisons work as expected
argumentList.add(new String(argument));
}
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/PreferencesCommandLine.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/PreferencesCommandLine.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/PreferencesCommandLine.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/PreferencesCommandLine.java Fri Mar 21 20:13:05 2008
@@ -44,30 +44,30 @@
*
* @see java.util.prefs.Preferences
* @see org.apache.commons.cli2.commandline.DefaultingCommandLine
- * @see org.apache.commons.cli2.Option#getPreferredName()
+ * @see org.apache.commons.cli2.Option#getPreferredName()
*/
public class PreferencesCommandLine extends CommandLineImpl {
-
+
private static final char NUL = '\0';
private final Preferences preferences;
private final Option root;
private final char separator;
-
+
/**
* Creates a new PreferencesCommandLine using the specified root Option and
* Preferences node. Argument values will be separated using the char 0.
- *
+ *
* @param root the CommandLine's root Option
* @param preferences the Preferences node to get values from
*/
public PreferencesCommandLine(final Option root, final Preferences preferences){
this(root,preferences,NUL);
}
-
+
/**
* Creates a new PreferencesCommandLine using the specified root Option,
* Preferences node and value separator.
- *
+ *
* @param root the CommandLine's root Option
* @param preferences the Preferences node to get values from
* @param separator the character to split argument values
@@ -77,7 +77,7 @@
this.preferences = preferences;
this.separator = separator;
}
-
+
public boolean hasOption(Option option) {
if(option==null){
return false;
@@ -97,18 +97,18 @@
public List getValues(final Option option, final List defaultValues) {
final String value = preferences.get(option.getPreferredName(),null);
-
+
if(value==null){
return defaultValues;
}
else if(separator>NUL){
final List values = new ArrayList();
final StringTokenizer tokens = new StringTokenizer(value,String.valueOf(separator));
-
+
while(tokens.hasMoreTokens()){
values.add(tokens.nextToken());
}
-
+
return values;
}
else{
@@ -128,7 +128,7 @@
return defaultValue;
}
}
-
+
public String getProperty(final String property, final String defaultValue) {
return preferences.get(property, defaultValue);
}
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/PropertiesCommandLine.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/PropertiesCommandLine.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/PropertiesCommandLine.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/PropertiesCommandLine.java Fri Mar 21 20:13:05 2008
@@ -40,15 +40,15 @@
*
* @see java.util.Properties
* @see org.apache.commons.cli2.commandline.DefaultingCommandLine
- * @see org.apache.commons.cli2.Option#getPreferredName()
+ * @see org.apache.commons.cli2.Option#getPreferredName()
*/
public class PropertiesCommandLine extends CommandLineImpl {
-
+
private static final char NUL = '\0';
private final Properties properties;
private final Option root;
private final char separator;
-
+
/**
* Creates a new PropertiesCommandLine using the specified root Option,
* Properties instance. The character 0 is used as the value separator.
@@ -59,7 +59,7 @@
public PropertiesCommandLine(final Option root, final Properties properties){
this(root,properties,NUL);
}
-
+
/**
* Creates a new PropertiesCommandLine using the specified root Option,
* Properties instance and value separator.
@@ -73,7 +73,7 @@
this.properties = properties;
this.separator = separator;
}
-
+
public boolean hasOption(Option option) {
if(option==null){
@@ -90,18 +90,18 @@
public List getValues(final Option option, final List defaultValues) {
final String value = properties.getProperty(option.getPreferredName());
-
+
if(value==null){
return defaultValues;
}
else if(separator>NUL){
final List values = new ArrayList();
final StringTokenizer tokens = new StringTokenizer(value,String.valueOf(separator));
-
+
while(tokens.hasMoreTokens()){
values.add(tokens.nextToken());
}
-
+
return values;
}
else{
@@ -121,7 +121,7 @@
return defaultValue;
}
}
-
+
public String getProperty(final String property, final String defaultValue) {
return properties.getProperty(property,defaultValue);
}
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/ArgumentImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/ArgumentImpl.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/ArgumentImpl.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/ArgumentImpl.java Fri Mar 21 20:13:05 2008
@@ -217,15 +217,15 @@
public String getConsumeRemaining() {
return this.consumeRemaining;
}
-
+
public List getDefaultValues() {
return this.defaultValues;
}
-
+
public Validator getValidator() {
return this.validator;
}
-
+
public void validate(final WriteableCommandLine commandLine)
throws OptionException {
validate(commandLine, this);
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/GroupImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/GroupImpl.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/GroupImpl.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/GroupImpl.java Fri Mar 21 20:13:05 2008
@@ -73,7 +73,7 @@
this.minimum = minimum;
this.maximum = maximum;
- // store a copy of the options to be used by the
+ // store a copy of the options to be used by the
// help methods
this.options = Collections.unmodifiableList(options);
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/HelpLineImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/HelpLineImpl.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/HelpLineImpl.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/HelpLineImpl.java Fri Mar 21 20:13:05 2008
@@ -35,17 +35,17 @@
/** The help settings used to obtain the previous usage */
private transient Set cachedHelpSettings;
-
+
/** The comparator used to obtain the previous usage */
private transient Comparator cachedComparator;
-
+
/** The previously obtained usage */
private transient String cachedUsage;
-
+
/**
* Creates a new HelpLineImpl to represent a particular Option in the online
* help.
- *
+ *
* @param option
* Option that the HelpLineImpl describes
* @param indent
@@ -76,12 +76,12 @@
public Option getOption() {
return option;
}
-
+
/**
- * Builds a usage string for the option using the specified settings and
+ * Builds a usage string for the option using the specified settings and
* comparator.
- *
- *
+ *
+ *
* @param helpSettings the settings to apply
* @param comparator a comparator to sort options when applicable
* @return the usage string
@@ -90,18 +90,18 @@
if (cachedUsage == null
|| cachedHelpSettings != helpSettings
|| cachedComparator != comparator) {
-
+
// cache the arguments to avoid redoing work
cachedHelpSettings = helpSettings;
cachedComparator = comparator;
-
+
// build the new buffer
final StringBuffer buffer = new StringBuffer();
for (int i = 0; i < indent; ++i) {
buffer.append(" ");
}
option.appendUsage(buffer, helpSettings, comparator);
-
+
// cache the usage string
cachedUsage = buffer.toString();
}
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/resource/ResourceHelper.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/resource/ResourceHelper.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/resource/ResourceHelper.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/resource/ResourceHelper.java Fri Mar 21 20:13:05 2008
@@ -40,7 +40,7 @@
private ResourceBundle bundle;
private String prop;
-
+
/**
* Create a new ResourceHelper for the current locale.
*/
@@ -52,12 +52,12 @@
}
this.prop = bundleName;
-
+
int firstUnderscore = bundleName.indexOf('_');
int secondUnderscore = bundleName.indexOf('_', firstUnderscore + 1);
Locale locale;
- if (firstUnderscore != -1) {
+ if (firstUnderscore != -1) {
String language = bundleName.substring(firstUnderscore + 1, secondUnderscore);
String country = bundleName.substring(secondUnderscore + 1);
locale = new Locale(language, country);
@@ -76,7 +76,7 @@
public String getBundleName() {
return this.prop;
}
-
+
/**
* Gets the ResourceHelper appropriate to the current locale.
* @return a ResourceHelper
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/util/Comparators.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/util/Comparators.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/util/Comparators.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/util/Comparators.java Fri Mar 21 20:13:05 2008
@@ -29,15 +29,15 @@
* A collection of Comparators suitable for use with Option instances.
*/
public class Comparators {
-
+
private Comparators(){
// constructor hiden from potential users
}
-
+
/**
* Chains comparators together.
- *
+ *
* @see #chain(Comparator[])
* @param c0
* a comparator
@@ -51,7 +51,7 @@
/**
* Chains comparators together.
- *
+ *
* @see #chain(Comparator[])
* @param c0
* a comparator
@@ -70,7 +70,7 @@
/**
* Chains comparators together.
- *
+ *
* @see #chain(Comparator[])
* @param c0
* a comparator
@@ -92,7 +92,7 @@
/**
* Chains comparators together.
- *
+ *
* @see #chain(Comparator[])
* @param c0
* a comparator
@@ -117,7 +117,7 @@
/**
* Chains comparators together.
- *
+ *
* @see #chain(Comparator[])
* @param comparators
* a List of comparators to chain together
@@ -133,7 +133,7 @@
* Chains an array of comparators together. Each Comparator will be called
* in turn until one of them return a non-zero value, this value will be
* returned.
- *
+ *
* @param comparators
* the array of comparators
* @return a chained comparator
@@ -169,7 +169,7 @@
/**
* Reverses a comparator's logic.
- *
+ *
* @param wrapped
* the Comparator to reverse the logic of
* @return a comparator with reverse logic
@@ -196,7 +196,7 @@
/**
* Forces Group instances to appear at the beginning of lists
- *
+ *
* @see Group
* @return a new comparator
*/
@@ -206,7 +206,7 @@
/**
* Forces Group instances to appear at the end of lists
- *
+ *
* @see Group
* @return a new comparator
*/
@@ -231,7 +231,7 @@
/**
* Forces Switch instances to appear at the beginning of lists
- *
+ *
* @see Switch
* @return a new comparator
*/
@@ -241,7 +241,7 @@
/**
* Forces Switch instances to appear at the end of lists
- *
+ *
* @see Switch
* @return a new comparator
*/
@@ -266,7 +266,7 @@
/**
* Forces Command instances to appear at the beginning of lists
- *
+ *
* @see Command
* @return a new comparator
*/
@@ -276,7 +276,7 @@
/**
* Forces Command instances to appear at the end of lists
- *
+ *
* @see Command
* @return a new comparator
*/
@@ -301,7 +301,7 @@
/**
* Forces DefaultOption instances to appear at the beginning of lists
- *
+ *
* @see DefaultOption
* @return a new comparator
*/
@@ -311,7 +311,7 @@
/**
* Forces DefaultOption instances to appear at the end of lists
- *
+ *
* @see DefaultOption
* @return a new comparator
*/
@@ -337,7 +337,7 @@
/**
* Forces Comparators with a particular trigger to appear at the beginning
* of lists
- *
+ *
* @param name
* the trigger name to select
* @see Option#getTriggers()
@@ -350,7 +350,7 @@
/**
* Forces Comparators with a particular trigger to appear at the end of
* lists
- *
+ *
* @param name
* the trigger name to select
* @see Option#getTriggers()
@@ -362,7 +362,7 @@
private static class Named implements Comparator {
private final String name;
-
+
/**
* Creates a Comparator that sorts a particular name high in order
* @param name the trigger name to select
@@ -389,7 +389,7 @@
/**
* Orders Options by preferredName
- *
+ *
* @see Option#getPreferredName()
* @return a new comparator
*/
@@ -399,7 +399,7 @@
/**
* Orders Options by preferredName, reversed
- *
+ *
* @see Option#getPreferredName()
* @return a new comparator
*/
@@ -418,29 +418,29 @@
/**
* Orders Options grouping required Options first
- *
+ *
* @see Option#isRequired()
* @return a new comparator
*/
public static Comparator requiredFirst() {
return new Required();
}
-
+
/**
* Orders Options grouping required Options last
- *
+ *
* @see Option#isRequired()
* @return a new comparator
*/
public static Comparator requiredLast() {
return reverse(requiredFirst());
}
-
+
private static class Required implements Comparator {
public int compare(final Object oleft, final Object oright) {
final Option left = (Option)oleft;
final Option right = (Option)oright;
-
+
final boolean l = left.isRequired();
final boolean r = right.isRequired();
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/util/HelpFormatter.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/util/HelpFormatter.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/util/HelpFormatter.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/util/HelpFormatter.java Fri Mar 21 20:13:05 2008
@@ -384,7 +384,7 @@
continue;
}
- // move to the next ideal wrap point
+ // move to the next ideal wrap point
right = (left + width) - 1;
// if we have run out of characters
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/FileValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/FileValidator.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/FileValidator.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/FileValidator.java Fri Mar 21 20:13:05 2008
@@ -26,7 +26,7 @@
* the {@link java.util.List} of values is replaced with the
* {@link java.io.File} instance.
*
- * The following attributes can also be specified using the
+ * The following attributes can also be specified using the
* appropriate settors:
* <ul>
* <li>writable</li>
@@ -47,12 +47,12 @@
* FileValidator validator = FileValidator.getExistingFileInstance();
* validator.setReadable(true);
* validator.setWritable(true);
- *
- * Argument age =
+ *
+ * Argument age =
* builder.withName("config");
* .withValidator(validator);
* </pre>
- *
+ *
* @author Rob Oxspring
* @author John Keyes
*/
@@ -95,16 +95,16 @@
/** whether the argument value is readable */
private boolean readable = false;
-
+
/** whether the argument value is writable */
private boolean writable = false;
-
+
/** whether the argument value exists */
private boolean existing = false;
-
+
/** whether the argument value is a directory */
private boolean directory = false;
-
+
/** whether the argument value is a file */
private boolean file = false;
@@ -115,7 +115,7 @@
* Validate the list of values against the list of permitted values.
* If a value is valid, replace the string in the <code>values</code>
* {@link java.util.List} with the {@link java.io.File} instance.
- *
+ *
* @see org.apache.commons.cli2.validation.Validator#validate(java.util.List)
*/
public void validate(final List values) throws InvalidArgumentException {
@@ -132,7 +132,7 @@
throw new InvalidArgumentException(name);
}
-
+
i.set(f);
}
}
@@ -149,7 +149,7 @@
/**
* Specifies whether the argument values must represent directories.
*
- * @param directory specifies whether the argument values must
+ * @param directory specifies whether the argument values must
* represent directories.
*/
public void setDirectory(boolean directory) {
@@ -157,10 +157,10 @@
}
/**
- * Returns whether the argument values must represent existing
+ * Returns whether the argument values must represent existing
* files/directories.
*
- * @return whether the argument values must represent existing
+ * @return whether the argument values must represent existing
* files/directories.
*/
public boolean isExisting() {
@@ -168,10 +168,10 @@
}
/**
- * Specifies whether the argument values must represent existing
+ * Specifies whether the argument values must represent existing
* files/directories.
*
- * @param existing specifies whether the argument values must
+ * @param existing specifies whether the argument values must
* represent existing files/directories.
*/
public void setExisting(boolean existing) {
@@ -190,7 +190,7 @@
/**
* Specifies whether the argument values must represent files.
*
- * @param file specifies whether the argument values must
+ * @param file specifies whether the argument values must
* represent files.
*/
public void setFile(boolean file) {
@@ -198,10 +198,10 @@
}
/**
- * Returns whether the argument values must represent hidden
+ * Returns whether the argument values must represent hidden
* files/directories.
*
- * @return whether the argument values must represent hidden
+ * @return whether the argument values must represent hidden
* files/directories.
*/
public boolean isHidden() {
@@ -209,10 +209,10 @@
}
/**
- * Specifies whether the argument values must represent hidden
+ * Specifies whether the argument values must represent hidden
* files/directories.
*
- * @param hidden specifies whether the argument values must
+ * @param hidden specifies whether the argument values must
* represent hidden files/directories.
*/
public void setHidden(boolean hidden) {
@@ -220,10 +220,10 @@
}
/**
- * Returns whether the argument values must represent readable
+ * Returns whether the argument values must represent readable
* files/directories.
*
- * @return whether the argument values must represent readable
+ * @return whether the argument values must represent readable
* files/directories.
*/
public boolean isReadable() {
@@ -231,10 +231,10 @@
}
/**
- * Specifies whether the argument values must represent readable
+ * Specifies whether the argument values must represent readable
* files/directories.
*
- * @param readable specifies whether the argument values must
+ * @param readable specifies whether the argument values must
* represent readable files/directories.
*/
public void setReadable(boolean readable) {
@@ -242,10 +242,10 @@
}
/**
- * Returns whether the argument values must represent writable
+ * Returns whether the argument values must represent writable
* files/directories.
*
- * @return whether the argument values must represent writable
+ * @return whether the argument values must represent writable
* files/directories.
*/
public boolean isWritable() {
@@ -253,10 +253,10 @@
}
/**
- * Specifies whether the argument values must represent writable
+ * Specifies whether the argument values must represent writable
* files/directories.
*
- * @param writable specifies whether the argument values must
+ * @param writable specifies whether the argument values must
* represent writable files/directories.
*/
public void setWritable(boolean writable) {
Modified: commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/Validator.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/Validator.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/Validator.java (original)
+++ commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/Validator.java Fri Mar 21 20:13:05 2008
@@ -32,10 +32,10 @@
/**
* Validate the specified values (List of Strings).
- *
+ *
* @param values The values to validate.
- *
- * @throws InvalidArgumentException If any of the
+ *
+ * @throws InvalidArgumentException If any of the
* specified values are not valid.
*/
void validate(final List values) throws InvalidArgumentException;
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/CLITestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/CLITestCase.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/CLITestCase.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/CLITestCase.java Fri Mar 21 20:13:05 2008
@@ -60,18 +60,18 @@
}
public static void assertListContentsEqual(final List expected, final List found) {
-
+
final Iterator e = expected.iterator();
final Iterator f = found.iterator();
-
+
while (e.hasNext() && f.hasNext()) {
assertEquals(e.next(), f.next());
}
-
+
if (e.hasNext()) {
fail("Expected more elements");
}
-
+
if (f.hasNext()) {
fail("Found more elements");
}
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/CommandLineDefaultsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/CommandLineDefaultsTest.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/CommandLineDefaultsTest.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/CommandLineDefaultsTest.java Fri Mar 21 20:13:05 2008
@@ -28,21 +28,21 @@
/**
* Tests the interaction of command line values and defaults supplied in different ways.
- *
+ *
* Tests marked _Parsed involve values parsed from a command line.
- *
+ *
* Tests marked _Method involve defaults supplied in the query method.
- *
+ *
* Tests marked _Option involce defaults specified in the model.
- *
+ *
* @author Rob Oxspring
*/
public class CommandLineDefaultsTest extends TestCase {
-
+
/*
- * utils to grab the default from the method
+ * utils to grab the default from the method
*/
-
+
private Object methodSwitch(WriteableCommandLine cl, Option o, Boolean bool) {
return cl.getSwitch(o, bool);
}
@@ -68,9 +68,9 @@
}
/*
- * utils to grab the default from the option model
+ * utils to grab the default from the option model
*/
-
+
private Option optionSwitch(Boolean bool) {
return new SwitchBuilder().withName("switch").withSwitchDefault(bool)
.create();
@@ -98,9 +98,9 @@
}
/*
- * utils to grab the input from the command line
+ * utils to grab the input from the command line
*/
-
+
private WriteableCommandLine parsedSwitch(Option o, Boolean bool) {
final List args;
if (bool == null) {
@@ -139,7 +139,7 @@
cl.addValue(o, "parsed");
return cl;
}
-
+
/*
* tests
*/
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/DocumentationTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/DocumentationTest.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/DocumentationTest.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/DocumentationTest.java Fri Mar 21 20:13:05 2008
@@ -47,7 +47,7 @@
/*
* --version -? -h --help -log file -s|-q|-v|-d Bursting File/Num/Date
* validation Switches Commands Auto help Auto exception help
- *
+ *
*/
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
Option version =
@@ -149,41 +149,41 @@
uoe.getMessage());
}
}
-
+
public void testManualIntroduction() {
-
+
DefaultOptionBuilder oBuilder = new DefaultOptionBuilder();
ArgumentBuilder aBuilder = new ArgumentBuilder();
GroupBuilder gBuilder = new GroupBuilder();
-
- DefaultOption xmlOption =
+
+ DefaultOption xmlOption =
oBuilder
.withLongName("xml")
.withDescription("Output using xml format")
.create();
-
- Argument pathArgument =
+
+ Argument pathArgument =
aBuilder
.withName("path")
.withMinimum(1)
.withMaximum(1)
.create();
-
- Group outputChildren =
+
+ Group outputChildren =
gBuilder
.withOption(xmlOption)
.create();
-
- Option outputOption =
+
+ Option outputOption =
oBuilder
.withLongName("output")
.withDescription("Outputs to a file")
.withArgument(pathArgument)
.withChildren(outputChildren)
.create();
-
+
///////////////////////////////////////////////////
-
+
Group options = outputChildren;
HelpFormatter hf = new HelpFormatter();
@@ -195,11 +195,11 @@
if(cl==null) {
System.exit(-1);
}
-
+
//////////////////////////////////////////////////
-
+
cl = new WriteableCommandLineImpl(outputChildren,new ArrayList());
-
+
// if we have --output option
if(cl.hasOption("--output")) {
// grab the path
@@ -209,15 +209,15 @@
// configure the application's output
configureOutput(path,xml);
}
-
-
-
-
+
+
+
+
}
private void configureOutput(String path, boolean xml) {
// TODO Auto-generated method stub
-
+
}
public void testExampleAnt() throws IOException, OptionException {
@@ -396,14 +396,14 @@
.withOption(find)
.withOption(targets)
.create();
-
+
/////////////////////////////////////
String[] args = new String[]{};
-
+
Parser parser = new Parser();
parser.setGroup(options);
CommandLine cl = parser.parse(args);
-
+
if(cl.hasOption(help)) {
//displayHelp();
return;
@@ -421,7 +421,7 @@
String target = (String) i.next();
//doTarget(target);
}
-
+
/////////////////////////////////////
HelpFormatter hf = new HelpFormatter();
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/WriteableCommandLineTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/WriteableCommandLineTestCase.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/WriteableCommandLineTestCase.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/WriteableCommandLineTestCase.java Fri Mar 21 20:13:05 2008
@@ -22,11 +22,11 @@
* @author Rob Oxspring
*/
public abstract class WriteableCommandLineTestCase extends CommandLineTestCase {
-
+
private WriteableCommandLine writeable;
-
+
protected abstract WriteableCommandLine createWriteableCommandLine();
-
+
/* (non-Javadoc)
* @see org.apache.commons.cli2.CommandLineTest#createCommandLine()
*/
@@ -42,7 +42,7 @@
cl.addValue(multiple,"value 3");
return cl;
}
-
+
/*
* @see CommandLineTest#setUp()
*/
@@ -60,17 +60,17 @@
assertTrue(writeable.getValues(present).isEmpty());
writeable.addValue(present,"value");
assertContentsEqual(list("value"),writeable.getValues(present));
-
+
// most options shouldn't appear due to adding values
assertFalse(writeable.hasOption(present));
-
+
final Argument arg = ArgumentTest.buildHostArgument();
-
+
assertFalse(writeable.hasOption(arg));
assertTrue(writeable.getValues(arg).isEmpty());
writeable.addValue(arg,"value");
assertContentsEqual(list("value"),writeable.getValues(arg));
-
+
// Arguments should force the option present
assertTrue(writeable.hasOption(arg));
}
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/application/CpTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/application/CpTest.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/application/CpTest.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/application/CpTest.java Fri Mar 21 20:13:05 2008
@@ -42,68 +42,68 @@
/**
* <p>Test the <code>cp</code> command. Duplicated Option types are not
* tested e.g. -a and -d are the same Option type.</p>
- *
+ *
* <p>The following is the man output for 'cp'. See
* <a href="http://www.rt.com/man/cp.1.html">http://www.rt.com/man/cp.1.html</a>.</p>
- *
+ *
* <pre>
* CP(1) FSF CP(1)
- *
+ *
* NAME cp - copy files and directories
- *
+ *
* SYNOPSIS cp [OPTION]... SOURCE DEST cp [OPTION]... SOURCE... DIRECTORY
- *
+ *
* DESCRIPTION Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
- *
+ *
* -a, --archive same as -dpR
- *
+ *
* -b, --backup make backup before removal
- *
+ *
* -d, --no-dereference preserve links
- *
+ *
* -f, --force remove existing destinations, never prompt
- *
+ *
* -i, --interactive prompt before overwrite
- *
+ *
* -l, --link link files instead of copying
- *
+ *
* -p, --preserve preserve file attributes if possible
- *
+ *
* -P, --parents append source path to DIRECTORY
* -r copy recursively, non-directories as files
- *
+ *
* --sparse=WHEN control creation of sparse files
- *
+ *
* -R, --recursive copy directories recursively
- *
+ *
* -s, --symbolic-link make symbolic links instead of copying
- *
+ *
* -S, --suffix=SUFFIX override the usual backup suffix
- *
+ *
* -u, --update copy only when the SOURCE file is newer than the destination file or when the destination file is missing
- *
+ *
* -v, --verbose explain what is being done
- *
+ *
* -V, --version-control=WORD override the usual version control
- *
+ *
* -x, --one-file-system stay on this file system
- *
+ *
* --help display this help and exit
- *
+ *
* --version output version information and exit
- *
+ *
* By default, sparse SOURCE files are detected by a crude heuristic and the corresponding DEST file is made sparse as well. That is the behavior selected by --sparse=auto. Specify --sparse=always to create a sparse DEST file when- ever the SOURCE file contains a long enough sequence of zero bytes. Use --sparse=never to inhibit creation of sparse files.
- *
+ *
* The backup suffix is ~, unless set with SIMPLE_BACKUP_SUF- FIX. The version control may be set with VERSION_CONTROL, values are:
* t, numbered make numbered backups
- *
+ *
* nil, existing numbered if numbered backups exist, simple other- wise
- *
+ *
* never, simple always make simple backups
- *
+ *
* As a special case, cp makes a backup of SOURCE when the force and backup options are given and SOURCE and DEST are the same name for an existing, regular file. * </pre>
* </pre>
- *
+ *
* @author Rob Oxspring
* @author John Keyes
*/
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/application/LsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/application/LsTest.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/application/LsTest.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/application/LsTest.java Fri Mar 21 20:13:05 2008
@@ -36,92 +36,92 @@
/**
* <p>Test the <code>ls</code> command. Duplicated Option types are not
* tested e.g. -a and -d are the same Option type.</p>
- *
+ *
* <p>The following is the man output for 'ls'. See
* <a href="http://www.rt.com/man/ls.1.html">http://www.rt.com/man/ls.1.html</a>.</p>
- *
+ *
* <pre>
* LS(1) FSF LS(1)
- *
+ *
* NAME ls - list directory contents
- *
+ *
* SYNOPSIS ls [OPTION]... [FILE]...
- *
+ *
* DESCRIPTION List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuSUX nor --sort.
- *
+ *
* -a, --all do not hide entries starting with .
- *
+ *
* -A, --almost-all do not list implied . and ..
- *
+ *
* -b, --escape print octal escapes for nongraphic characters
- *
+ *
* --block-size=SIZE use SIZE-byte blocks
- *
+ *
* -B, --ignore-backups do not list implied entries ending with ~ -c sort by change time; with -l: show ctime -C list entries by columns
- *
+ *
* --color[=WHEN] control whether color is used to distinguish file types. WHEN may be `never', `always', or `auto'
- *
+ *
* -d, --directory list directory entries instead of contents
- *
+ *
* -D, --dired generate output designed for Emacs' dired mode -f do not sort, enable -aU, disable -lst
- *
+ *
* -F, --classify append indicator (one of /=@|*) to entries
- *
+ *
* --format=WORD across -x, commas -m, horizontal -x, long -l, sin- gle-column -1, verbose -l, vertical -C
- *
+ *
* --full-time list both full date and full time -g (ignored)
- *
+ *
* -G, --no-group inhibit display of group information
- *
+ *
* -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
- *
+ *
* -H, --si likewise, but use powers of 1000 not 1024
- *
+ *
* --indicator-style=WORD append indicator with style WORD to entry names: none (default), classify (-F), file-type (-p)
- *
+ *
* -i, --inode print index number of each file
- *
+ *
* -I, --ignore=PATTERN do not list implied entries matching shell PATTERN
- *
+ *
* -k, --kilobytes like --block-size=1024 -l use a long listing format
- *
+ *
* -L, --dereference list entries pointed to by symbolic links -m fill width with a comma separated list of entries
- *
+ *
* -n, --numeric-uid-gid list numeric UIDs and GIDs instead of names
- *
+ *
* -N, --literal print raw entry names (don't treat e.g. control characters specially) -o use long listing format without group info
- *
+ *
* -p, --file-type append indicator (one of /=@|) to entries
- *
+ *
* -q, --hide-control-chars print ? instead of non graphic characters
- *
+ *
* --show-control-chars show non graphic characters as-is (default)
- *
+ *
* -Q, --quote-name enclose entry names in double quotes
- *
+ *
* --quoting-style=WORD use quoting style WORD for entry names: literal, shell, shell-always, c, escape
- *
+ *
* -r, --reverse reverse order while sorting
- *
+ *
* -R, --recursive list subdirectories recursively
- *
+ *
* -s, --size print size of each file, in blocks -S sort by file size
- *
+ *
* --sort=WORD extension -X, none -U, size -S, time -t, version -v status -c, time -t, atime -u, access -u, use -u
- *
+ *
* --time=WORD show time as WORD instead of modification time: atime, access, use, ctime or status; use specified time as sort key if --sort=time -t sort by modification time
- *
+ *
* -T, --tabsize=COLS assume tab stops at each COLS instead of 8 -u sort by last access time; with -l: show atime -U do not sort; list entries in directory order -v sort by version
- *
+ *
* -w, --width=COLS assume screen width instead of current value -x list entries by lines instead of by columns -X sort alphabetically by entry extension -1 list one file per line
- *
+ *
* --help display this help and exit
- *
+ *
* --version output version information and exit
- *
+ *
* By default, color is not used to distinguish types of files. That is equivalent to using --color=none. Using the --color option without the optional WHEN argument is equivalent to using --color=always. With --color=auto, color codes are output only if standard output is con- nected to a terminal (tty).
* </pre>
- *
+ *
* @author Rob Oxspring
* @author John Keyes
*/
@@ -145,7 +145,7 @@
/**
* Required ctor.
- *
+ *
* @param name
* the name of the TestCase
*/
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug27575Test.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug27575Test.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug27575Test.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug27575Test.java Fri Mar 21 20:13:05 2008
@@ -31,7 +31,7 @@
builder.withPattern("hc!<");
Option option = builder.create();
assertTrue(option instanceof GroupImpl);
-
+
GroupImpl group = (GroupImpl)option;
Iterator i = group.getOptions().iterator();
assertEquals("[-h]",i.next().toString());
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug28005Test.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug28005Test.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug28005Test.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug28005Test.java Fri Mar 21 20:13:05 2008
@@ -33,42 +33,42 @@
final ArgumentBuilder argumentBuilder = new ArgumentBuilder();
final GroupBuilder groupBuilder = new GroupBuilder();
final CommandBuilder commandBuilder = new CommandBuilder();
-
- final Option inputFormatOption =
+
+ final Option inputFormatOption =
optionBuilder
.withLongName("input-format")
//.withArgument(argumentBuilder.create())
.create();
-
- final Argument argument =
+
+ final Argument argument =
argumentBuilder
.withName("file")
.create();
-
- final Group children =
+
+ final Group children =
groupBuilder
.withName("options")
.withOption(inputFormatOption)
.create();
-
- final Option command =
+
+ final Option command =
commandBuilder
.withName("convert")
.withChildren(children)
.withArgument(argument)
.create();
-
- final Group root =
+
+ final Group root =
groupBuilder
.withName("commands")
.withOption(command)
.create();
-
+
final Parser parser = new Parser();
parser.setGroup(root);
final String[] args = new String[]{"convert", "test.txt",
"--input-format", "a"};
-
+
try {
parser.parse(args);
fail("a isn't valid!!");
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug32533Test.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug32533Test.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug32533Test.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/bug/Bug32533Test.java Fri Mar 21 20:13:05 2008
@@ -29,18 +29,18 @@
* @author roxspring
*/
public class Bug32533Test extends TestCase {
-
+
public void testBlah() throws OptionException {
-
+
Option a1 = new DefaultOptionBuilder().withLongName("a1").create();
Option b1 = new DefaultOptionBuilder().withLongName("b1").create();
Option c1 = new DefaultOptionBuilder().withLongName("c1").create();
-
+
Group b = new GroupBuilder().withOption(b1).create();
Group c = new GroupBuilder().withOption(c1).create();
Group a = new GroupBuilder().withOption(a1).withOption(b).withOption(c).create();
-
- Parser parser = new Parser();
+
+ Parser parser = new Parser();
parser.setGroup(a);
parser.parse(new String[]{"--a1","--b1"});
}
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/DefaultingCommandLineTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/DefaultingCommandLineTest.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/DefaultingCommandLineTest.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/DefaultingCommandLineTest.java Fri Mar 21 20:13:05 2008
@@ -128,7 +128,7 @@
assertSame(first, i.next());
assertFalse(i.hasNext());
}
-
+
public void testTriggers() {
final DefaultingCommandLine defaults = new DefaultingCommandLine();
defaults.appendCommandLine(first);
@@ -144,7 +144,7 @@
public void testDefaults() {
final DefaultingCommandLine defaults = new DefaultingCommandLine();
-
+
assertEquals("wrong # of defaults", 0, defaults.getValues("--insecond").size());
assertEquals("wrong Set of defaults", Collections.EMPTY_LIST, defaults.getValues("--insecond", null));
}
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/PreferencesCommandLineTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/PreferencesCommandLineTest.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/PreferencesCommandLineTest.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/PreferencesCommandLineTest.java Fri Mar 21 20:13:05 2008
@@ -27,7 +27,7 @@
* @author Rob Oxspring
*/
public class PreferencesCommandLineTest extends CommandLineTestCase {
-
+
/* (non-Javadoc)
* @see org.apache.commons.cli2.CommandLineTest#createCommandLine()
*/
@@ -38,9 +38,9 @@
props.put("--alsopresent","");
props.put("--multiple","value 1|value 2|value 3");
props.put("--bool","true");
-
+
props.put("present","present property");
-
+
return new PreferencesCommandLine(root,props,'|');
}
@@ -51,16 +51,16 @@
props.put("--alsopresent","");
props.put("--multiple","value 1|value 2|value 3");
props.put("--bool","false");
-
+
props.put("present","present property");
-
+
return new PreferencesCommandLine(root,props);
}
-
+
public void testPropertyValues() {
// nothing to test
CommandLine cmdline = createCommandLine();
-
+
assertEquals("wrong value", "present value", cmdline.getValue("--present"));
assertEquals("wrong value", "present value", cmdline.getValue("--alsopresent"));
assertEquals("wrong # of values", 3, cmdline.getValues("--multiple").size());
@@ -68,18 +68,18 @@
assertEquals("wrong value 2", "value 2", cmdline.getValues("--multiple").get(1));
assertEquals("wrong value 3", "value 3", cmdline.getValues("--multiple").get(2));
}
-
+
public void testNoSeparator() {
// nothing to test
CommandLine cmdline = createCommandLineNoSep();
-
+
assertEquals("wrong value", "present value", cmdline.getValue("--present"));
assertEquals("wrong value", "present value", cmdline.getValue("--alsopresent"));
assertEquals("wrong # of values", 1, cmdline.getValues("--multiple").size());
assertEquals("wrong value", "value 1|value 2|value 3", cmdline.getValue("--multiple"));
assertFalse("expected a false", cmdline.getSwitch("--bool").booleanValue());
}
-
+
public void testNullOption() {
// nothing to test
CommandLine cmdline = createCommandLine();
@@ -99,7 +99,7 @@
assertTrue("cannot find trigger", triggers.contains("--present"));
assertTrue("cannot find trigger", triggers.contains("--multiple"));
assertTrue("cannot find trigger", triggers.contains("--alsopresent"));
-
+
assertFalse("should not find null option", cmdline.hasOption((String) null));
assertTrue("expected a true", cmdline.getSwitch("--bool").booleanValue());
}
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/PropertiesCommandLineTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/PropertiesCommandLineTest.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/PropertiesCommandLineTest.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/commandline/PropertiesCommandLineTest.java Fri Mar 21 20:13:05 2008
@@ -51,11 +51,11 @@
props.setProperty("present", "present property");
return new PropertiesCommandLine(root, props);
}
-
+
public void testPropertyValues() {
// nothing to test
CommandLine cmdline = createCommandLine();
-
+
assertEquals("wrong value", "present value", cmdline.getValue("--present"));
assertEquals("wrong value", "present value", cmdline.getValue("--alsopresent"));
assertEquals("wrong # of values", 3, cmdline.getValues("--multiple").size());
@@ -63,18 +63,18 @@
assertEquals("wrong value 2", "value 2", cmdline.getValues("--multiple").get(1));
assertEquals("wrong value 3", "value 3", cmdline.getValues("--multiple").get(2));
}
-
+
public void testNoSeparator() {
// nothing to test
CommandLine cmdline = createCommandLineNoSep();
-
+
assertEquals("wrong value", "present value", cmdline.getValue("--present"));
assertEquals("wrong value", "present value", cmdline.getValue("--alsopresent"));
assertEquals("wrong # of values", 1, cmdline.getValues("--multiple").size());
assertEquals("wrong value", "value 1|value 2|value 3", cmdline.getValue("--multiple"));
assertFalse("expected a false", cmdline.getSwitch("--bool").booleanValue());
}
-
+
public void testNullOption() {
// nothing to test
CommandLine cmdline = createCommandLine();
@@ -94,7 +94,7 @@
assertTrue("cannot find trigger", triggers.contains("--present"));
assertTrue("cannot find trigger", triggers.contains("--multiple"));
assertTrue("cannot find trigger", triggers.contains("--alsopresent"));
-
+
assertFalse("should not find null option", cmdline.hasOption((String) null));
assertTrue("expected a true", cmdline.getSwitch("--bool").booleanValue());
}
Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/jdepend/JDependTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/jdepend/JDependTest.java?rev=639944&r1=639943&r2=639944&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/jdepend/JDependTest.java (original)
+++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/jdepend/JDependTest.java Fri Mar 21 20:13:05 2008
@@ -81,10 +81,10 @@
final Collection dependsUpon = cli2Packages(apiPackage.getEfferents());
assertEquals("Api should depend on one package", 1, dependsUpon.size());
-
+
JavaPackage pkg = (JavaPackage) dependsUpon.iterator().next();
assertEquals(
- "Wrong package name",
+ "Wrong package name",
"org.apache.commons.cli2.resource",
pkg.getName());
}
|