|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.minorthird.util.JointCommandLineProcessor
public class JointCommandLineProcessor
A lightweight command-line processing tool.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface edu.cmu.minorthird.util.CommandLineProcessor |
---|
CommandLineProcessor.Configurable |
Constructor Summary | |
---|---|
JointCommandLineProcessor(CommandLineProcessor[] subprocessor)
|
Method Summary | |
---|---|
int |
consumeArguments(java.lang.String[] args,
int startPos)
Try to consume a the command-line argument at position i. |
void |
help()
|
void |
processArguments(java.lang.String[] args)
Loop thru the command-line arguments. |
boolean |
shouldTerminate()
Specifies whether the commandline processing should terminate. |
void |
usage()
Give usage() information. |
void |
usage(java.lang.String errorMessage)
Prints errorMessage and then calls usage(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JointCommandLineProcessor(CommandLineProcessor[] subprocessor)
Method Detail |
---|
public boolean shouldTerminate()
CommandLineProcessor
shouldTerminate
in interface CommandLineProcessor
public final void processArguments(java.lang.String[] args)
CommandLineProcessor
If function like -foo happens to return a non-null
CommandLineProcessor, that processor is invoked on the
arguments immediately after foo. This allows one
CommandLineProcessor to pass command-line options to a second
one. For instance, if x and y are CommandLineProcessors, x has
an method colorOpts() that returns y, and y has methods
background(String s) and foreground(String t) then the command
line sequence -colorOpts -background blue -foreground
red
would call the expected methods of y.
The optional "-config FILE" should cause a Properties object to be loaded from FILE, and the property/value pairs in the Properties object to be treated as if they were option/argument pairs. The order of lines in the property file may not be preserved, however, and duplicated keys will be ignored.
For instance, calling -config FILE for a FILE containing
would be the same as the command options
baz=
foo=bar
-foo bar -baz
or possibly -baz -foo bar
processArguments
in interface CommandLineProcessor
public final int consumeArguments(java.lang.String[] args, int startPos)
CommandLineProcessor
consumeArguments
in interface CommandLineProcessor
public final void usage(java.lang.String errorMessage)
CommandLineProcessor
usage
in interface CommandLineProcessor
public final void usage()
CommandLineProcessor
usage
in interface CommandLineProcessor
public final void help()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |