commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berin Loritsch" <blorit...@apache.org>
Subject RE: [CLI] Feature requests and submissions
Date Fri, 02 Aug 2002 13:48:36 GMT
> From: John Keyes [mailto:jbjk@mac.com] 
> 
> I have added the array method, as someone may prefer the 
> array approach to the Collections one.

I threw together the array method to assist me trying to convert the
Avalon CLI testcase to use Commons.  I can send you what I have so far
off line--but it is incomplete, won't compile, etc.  I am having issues
with Maven.  Let me know if you are interested.  Who knows, you might
be able to clean it up a lot better than I could.

Here is the diff for the array method:

------------------------------------------------------------------------
----

? src/test/org/apache/commons/cli/ExcaliburCLICompatTest.java
Index: src/java/org/apache/commons/cli/CommandLine.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/CommandLin
e.java,v
retrieving revision 1.4
cvs server: Diffing src/test/org/apache/commons
diff -b -u -r1.4 CommandLine.java
--- src/java/org/apache/commons/cli/CommandLine.java	31 Jul 2002
22:24:29 -0000	1.4
cvs server: Diffing src/test/org/apache/commons/cli
cvs server: Diffing xdocs
+++ src/java/org/apache/commons/cli/CommandLine.java	2 Aug 2002
13:42:51 -0000
@@ -64,6 +64,7 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.Map;
 
@@ -207,5 +208,22 @@
     public Iterator iterator( ) {
         return options.values().iterator();
     }
+
+    /**
+     * <p>Returns a List of Options in the CommandLine.</p>
+     *
+     * @return a <code>List</code> over the processed {@link Option}
+     * members of this {@link CommandLine}
+     */
+     public List getOptionList() {
+         List optionList = new ArrayList(options.values().size());
+
+         Iterator it = options.values().iterator();
+         while (it.hasNext()) {
+             optionList.add( it.next() );
+         }
+
+         return optionList;
+     }
 
 }


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message