at.dms.util
Class Options

java.lang.Object
  |
  +--at.dms.util.Options
Direct Known Subclasses:
BackendOptions, ClassfileOptions, DisOptions, KjcOptions, KsmOptions, LexgenOptions, OptimizeOptions

public abstract class Options
extends java.lang.Object

Options parser.


Field Summary
 java.lang.String[] nonOptions
          The array of non-option arguments.
 
Constructor Summary
Options(java.lang.String name)
          Creates a new Option object.
 
Method Summary
protected  int getInt(gnu.getopt.Getopt g, int defaultValue)
           
 gnu.getopt.LongOpt[] getLongOptions()
          Gets long options
 java.lang.String[] getOptions()
           
 java.lang.String getShortOptions()
          Gets short options
protected  java.lang.String getString(gnu.getopt.Getopt g, java.lang.String defaultValue)
           
protected abstract  void help()
          shows an usage message
 boolean parseCommandLine(java.lang.String[] argv)
           
 boolean parseCommandLine(java.lang.String[] argv, java.util.List infiles)
          Parses and evaluates the command line arguments.
 void printOptions()
          Prints the options
 boolean processOption(int code, gnu.getopt.Getopt g)
           
protected abstract  void usage()
          shows a help message
protected abstract  void version()
          shows the version number
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nonOptions

public java.lang.String[] nonOptions
The array of non-option arguments.
Constructor Detail

Options

public Options(java.lang.String name)
Creates a new Option object.
Parameters:
name - the command name to pass to getopt.
Method Detail

parseCommandLine

public boolean parseCommandLine(java.lang.String[] argv)

parseCommandLine

public boolean parseCommandLine(java.lang.String[] argv,
                                java.util.List infiles)
Parses and evaluates the command line arguments.
Parameters:
argv - the command line arguments
infiles - where to put non-option arguments
Returns:
true iff the command line was parsed successfully

processOption

public boolean processOption(int code,
                             gnu.getopt.Getopt g)
Parameters:
args - the command line arguments

getOptions

public java.lang.String[] getOptions()

printOptions

public void printOptions()
Prints the options

help

protected abstract void help()
shows an usage message

version

protected abstract void version()
shows the version number

usage

protected abstract void usage()
shows a help message

getInt

protected int getInt(gnu.getopt.Getopt g,
                     int defaultValue)

getString

protected java.lang.String getString(gnu.getopt.Getopt g,
                                     java.lang.String defaultValue)

getShortOptions

public java.lang.String getShortOptions()
Gets short options

getLongOptions

public gnu.getopt.LongOpt[] getLongOptions()
Gets long options