com.darwinsys.util
Class GetOpt

java.lang.Object
  |
  +--com.darwinsys.util.GetOpt

public class GetOpt
extends java.lang.Object

A class to implement UNIX-style (single-character) command arguments


Field Summary
protected  boolean done
          Internal flag - whether we are done all the options
static int DONE
          Public constant for "no more options" XXX should switch to hasNext()/next() pattern.
protected  java.lang.String optarg
          The option argument, if there is one.
protected  int optind
          Where we are in the options
protected  java.lang.String pattern
          The set of characters to look for
 
Constructor Summary
GetOpt(java.lang.String patt)
           
 
Method Summary
 char getopt(java.lang.String[] argv)
          Return one argument.
 int getOptInd()
          Retrieve the option index
 java.lang.String optarg()
          Retrieve the current option argument
 void rewind()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pattern

protected java.lang.String pattern
The set of characters to look for

optind

protected int optind
Where we are in the options

DONE

public static final int DONE
ic constant for "no more options" XXX should switch to hasNext()/next() pattern.

done

protected boolean done
Internal flag - whether we are done all the options

optarg

protected java.lang.String optarg
The option argument, if there is one.
Constructor Detail

GetOpt

public GetOpt(java.lang.String patt)
Method Detail

getOptInd

public int getOptInd()
Retrieve the option index

optarg

public java.lang.String optarg()
Retrieve the current option argument

rewind

public void rewind()

getopt

public char getopt(java.lang.String[] argv)
Return one argument.