You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by jk...@apache.org on 2002/11/15 23:25:58 UTC
cvs commit: jakarta-commons/cli/src/java/org/apache/commons/cli Options.java
jkeyes 2002/11/15 14:25:58
Modified: cli/src/java/org/apache/commons/cli Options.java
Log:
fix the first problem that Rob found yesterday wiht helpOptions
Revision Changes Path
1.15 +10 -10 jakarta-commons/cli/src/java/org/apache/commons/cli/Options.java
Index: Options.java
===================================================================
RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/Options.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Options.java 24 Oct 2002 23:17:49 -0000 1.14
+++ Options.java 15 Nov 2002 22:25:58 -0000 1.15
@@ -187,6 +187,15 @@
* @return read-only Collection of {@link Option} objects in this descriptor
*/
public Collection getOptions() {
+ return Collections.unmodifiableCollection( helpOptions() );
+ }
+
+ /**
+ * <p>Returns the Options for use by the HelpFormatter.</p>
+ *
+ * @return the List of Options
+ */
+ List helpOptions() {
List opts = new ArrayList( shortOpts.values() );
// now look through the long opts to see if there are any Long-opt
@@ -200,16 +209,7 @@
opts.add(item);
}
}
- return Collections.unmodifiableCollection( opts );
- }
-
- /**
- * <p>Returns the Options for use by the HelpFormatter.</p>
- *
- * @return the List of Options
- */
- List helpOptions() {
- return new ArrayList( shortOpts.values() );
+ return new ArrayList( opts );
}
/** <p>Returns the required options as a
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>