Skip to content

Commit c08f738

Browse files
author
John Keyes
committed
changed my email add, removed CommandLineParserFactory
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/cli/trunk@129816 13f79535-47bb-0310-9956-ffa450edef68
1 parent b1efd86 commit c08f738

23 files changed

Lines changed: 107 additions & 165 deletions

src/java/org/apache/commons/cli/AlreadySelectedException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
* <p>Thrown when more than one option in an option group
6565
* has been provided.</p>
6666
*
67-
* @author John Keyes ( jbjk at mac.com )
67+
* @author John Keyes ( john at integralsource.com )
6868
* @see ParseException
6969
*/
7070
public class AlreadySelectedException extends ParseException {

src/java/org/apache/commons/cli/BasicParser.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//cli/src/java/org/apache/commons/cli/BasicParser.java,v 1.2 2002/08/26 20:15:02 jkeyes Exp $
3-
* $Revision: 1.2 $
4-
* $Date: 2002/08/26 20:15:02 $
2+
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//cli/src/java/org/apache/commons/cli/BasicParser.java,v 1.3 2002/09/19 22:59:43 jkeyes Exp $
3+
* $Revision: 1.3 $
4+
* $Date: 2002/09/19 22:59:43 $
55
*
66
* ====================================================================
77
*
@@ -64,7 +64,7 @@
6464
* The class BasicParser provides a very simple implementation of
6565
* the {@link Parser#flatten(Options,String[],boolean) flatten} method.
6666
*
67-
* @author John Keyes (jbjk at mac.com)
67+
* @author John Keyes (john at integralsource.com)
6868
* @see Parser
6969
*/
7070
public class BasicParser extends Parser {

src/java/org/apache/commons/cli/CommandLine.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
*/
6161
package org.apache.commons.cli;
6262

63+
import java.util.ArrayList;
6364
import java.util.Collection;
6465
import java.util.HashMap;
6566
import java.util.Iterator;
@@ -80,7 +81,7 @@
8081
*
8182
* @author bob mcwhirter (bob @ werken.com)
8283
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
83-
* @author John Keyes (jbjk at mac.com)
84+
* @author John Keyes (john at integralsource.com)
8485
*/
8586
public class CommandLine {
8687

@@ -92,6 +93,8 @@ public class CommandLine {
9293

9394
/** Map of unique options for ease to get complete list of options */
9495
private Map hashcodeMap = new HashMap();
96+
private List optionList = new ArrayList();
97+
private List keyList = new ArrayList();
9598

9699
/** the processed options */
97100
private Option[] optionsArray;
@@ -282,13 +285,16 @@ void addArg(String arg) {
282285
*
283286
* @param opt the processed option
284287
*/
285-
void setOpt( Option opt ) {
288+
void addOption( Option opt ) {
286289
hashcodeMap.put( new Integer( opt.hashCode() ), opt );
287290

291+
optionList.add( opt );
288292
String key = opt.getOpt();
289293
if( " ".equals(key) ) {
290294
key = opt.getLongOpt();
291295
}
296+
keyList.add( key );
297+
292298
if( options.get( key ) != null ) {
293299
((java.util.List)options.get( key )).add( opt );
294300
}
@@ -323,4 +329,14 @@ public Option[] getOptions( ) {
323329
return (Option[]) processed.toArray( optionsArray );
324330
}
325331

332+
public Option[] getOptions2() {
333+
System.out.println( "--2--" );
334+
Collection processed = optionList;
335+
// reinitialise array
336+
optionsArray = new Option[ processed.size() ];
337+
338+
// return the array
339+
return (Option[]) processed.toArray( optionsArray );
340+
}
341+
326342
}

src/java/org/apache/commons/cli/CommandLineParser.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//cli/src/java/org/apache/commons/cli/CommandLineParser.java,v 1.3 2002/08/26 20:15:02 jkeyes Exp $
3-
* $Revision: 1.3 $
4-
* $Date: 2002/08/26 20:15:02 $
2+
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//cli/src/java/org/apache/commons/cli/CommandLineParser.java,v 1.4 2002/09/19 22:59:43 jkeyes Exp $
3+
* $Revision: 1.4 $
4+
* $Date: 2002/09/19 22:59:43 $
55
*
66
* ====================================================================
77
*
@@ -65,7 +65,7 @@
6565
* can parse a String array according to the {@link Options} specified
6666
* and return a {@link CommandLine}.
6767
*
68-
* @author John Keyes (jbjk at mac.com)
68+
* @author John Keyes (john at integralsource.com)
6969
*/
7070
public interface CommandLineParser {
7171

src/java/org/apache/commons/cli/CommandLineParserFactory.java

Lines changed: 0 additions & 105 deletions
This file was deleted.

src/java/org/apache/commons/cli/GnuParser.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//cli/src/java/org/apache/commons/cli/GnuParser.java,v 1.9 2002/08/31 17:53:11 jkeyes Exp $
3-
* $Revision: 1.9 $
4-
* $Date: 2002/08/31 17:53:11 $
2+
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//cli/src/java/org/apache/commons/cli/GnuParser.java,v 1.10 2002/09/19 22:59:43 jkeyes Exp $
3+
* $Revision: 1.10 $
4+
* $Date: 2002/09/19 22:59:43 $
55
*
66
* ====================================================================
77
*
@@ -69,9 +69,9 @@
6969
* The class GnuParser provides an implementation of the
7070
* {@link Parser#flatten(Options,String[],boolean) flatten} method.
7171
*
72-
* @author John Keyes (jbjk at mac.com)
72+
* @author John Keyes (john at integralsource.com)
7373
* @see Parser
74-
* @version $Revision: 1.9 $
74+
* @version $Revision: 1.10 $
7575
*/
7676
public class GnuParser extends Parser {
7777

src/java/org/apache/commons/cli/HelpFormatter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
* A formatter of help messages for the current command line options
7474
*
7575
* @author Slawek Zachcial
76-
* @author John Keyes (jbjk at mac.com)
76+
* @author John Keyes (john at integralsource.com)
7777
**/
7878
public class HelpFormatter
7979
{

src/java/org/apache/commons/cli/MissingArgumentException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
* <p>Thrown when an option requiring an argument
6666
* is not provided with an argument.</p>
6767
*
68-
* @author John Keyes (jbjk at mac.com)
68+
* @author John Keyes (john at integralsource.com)
6969
* @see ParseException
7070
*/
7171
public class MissingArgumentException extends ParseException {

src/java/org/apache/commons/cli/MissingOptionException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
/**
6565
* <p>Thrown when a required option has not been provided.</p>
6666
*
67-
* @author John Keyes ( jbjk at mac.com )
67+
* @author John Keyes ( john at integralsource.com )
6868
* @see ParseException
6969
*/
7070
public class MissingOptionException extends ParseException {

src/java/org/apache/commons/cli/OptionBuilder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//cli/src/java/org/apache/commons/cli/OptionBuilder.java,v 1.9 2002/09/10 21:35:57 jkeyes Exp $
3-
* $Revision: 1.9 $
4-
* $Date: 2002/09/10 21:35:57 $
2+
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//cli/src/java/org/apache/commons/cli/OptionBuilder.java,v 1.10 2002/09/19 22:59:43 jkeyes Exp $
3+
* $Revision: 1.10 $
4+
* $Date: 2002/09/19 22:59:43 $
55
*
66
* ====================================================================
77
*
@@ -67,7 +67,7 @@
6767
* <p>Details on the Builder pattern can be found at
6868
* <a href="http://">http://</a>.</p>
6969
*
70-
* @author John Keyes ( jbjk at mac.com )
70+
* @author John Keyes ( john at integralsource.com )
7171
* @since 1.0
7272
*/
7373
public class OptionBuilder {

0 commit comments

Comments
 (0)