public final class CommandLine extends Object
OptionProcessors.| 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
OptionProcessors. |
void |
process(String[] args,
InputStream is,
OutputStream os,
OutputStream err,
File currentDir)
Process the array of arguments and invoke associated
OptionProcessors. |
void |
usage(PrintWriter w)
Prints the usage information about options provided by associated
OptionProcessors. |
public static CommandLine getDefault()
OptionProcessors is taken from default
Lookup.getDefault().public void process(String... args) throws CommandException
OptionProcessors.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
OptionProcessors.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)
OptionProcessors.w - the writer to output usage info toBuilt on August 24 2014. | Portions Copyright 1997-2014 Sun Microsystems, Inc. All rights reserved.