public final class CommandLine extends Object
OptionProcessor
s.Modifier and Type | Method and Description |
---|---|
static CommandLine |
getDefault()
Getter for the default command line processor in the system.
|
void |
process(String... args)
Process the array of arguments and invoke associated
OptionProcessor s. |
void |
process(String[] args,
InputStream is,
OutputStream os,
OutputStream err,
File currentDir)
Process the array of arguments and invoke associated
OptionProcessor s. |
void |
usage(PrintWriter w)
Prints the usage information about options provided by associated
OptionProcessor s. |
public static CommandLine getDefault()
OptionProcessor
s is taken from default
Lookup.getDefault()
.public void process(String... args) throws CommandException
OptionProcessor
s.args
- the array of strings to processCommandException
- if processing is not possible or failedpublic void process(String[] args, InputStream is, OutputStream os, OutputStream err, File currentDir) throws CommandException
OptionProcessor
s.args
- the array of strings to processis
- the input stream that processors can reados
- the output stream that processors can write toerr
- the output stream that processors can send error messages tocurrentDir
- directory that processors should use as current user dirCommandException
- if processing is not possible or failedpublic void usage(PrintWriter w)
OptionProcessor
s.w
- the writer to output usage info toBuilt on July 21 2012. | Portions Copyright 1997-2012 Sun Microsystems, Inc. All rights reserved.