net.praqma.util.option
Class Options

java.lang.Object
  extended by net.praqma.util.option.Options

public class Options
extends Object

An Option has a longName and an optional shortName. The longName is prefixed with double dashes, "--" and followed by an optional equal sign, "=".
The shortName is prefixed with a single dash, "-".
Options can have an arbitrary number of values, for example, --option=a b c d, --option a b e f, -o a b "c d e f"

An Option is initialized:
Option o1 = new Option( "major", "m", false, 1, "The major version of the change set to stamp" );

The Option is then set into the Options. Parsed. And checked.
The Option's can then be used to extract option values from the CLI.

Author:
wolfgang

Field Summary
static String linesep
           
 
Constructor Summary
Options()
           
Options(String version)
           
 
Method Summary
 void checkOptions()
           
 void display()
           
 void parse(String[] args)
           
 void print()
           
 void setDefaultOptions()
           
 void setDescription(String desc)
           
 void setHeader(String header)
           
 void setOption(Option option)
           
 void setSyntax(String syntax)
           
 String toString()
           
 boolean verbose()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

linesep

public static final String linesep
Constructor Detail

Options

public Options()

Options

public Options(String version)
Method Detail

setDefaultOptions

public void setDefaultOptions()

setSyntax

public void setSyntax(String syntax)

setDescription

public void setDescription(String desc)

setHeader

public void setHeader(String header)

setOption

public void setOption(Option option)

parse

public void parse(String[] args)

checkOptions

public void checkOptions()
                  throws Exception
Throws:
Exception

verbose

public boolean verbose()

print

public void print()

display

public void display()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.