edu.umd.cs.findbugs.config
public abstract class CommandLine extends Object
Nested Class Summary | |
---|---|
static class | CommandLine.HelpRequestedException |
Constructor Summary | |
---|---|
CommandLine() |
Method Summary | |
---|---|
void | addOption(String option, String argumentDesc, String description)
Add an option requiring an argument.
|
void | addSwitch(String option, String description)
Add a command line switch.
|
void | addSwitchWithOptionalExtraPart(String option, String optionExtraPartSynopsis, String description)
Add a command line switch that allows optional extra
information to be specified as part of it.
|
static String[] | expandOptionFiles(String[] argv, boolean ignoreComments, boolean ignoreBlankLines)
Expand option files in given command line.
|
protected abstract void | handleOption(String option, String optionExtraPart)
Callback method for handling an option.
|
protected abstract void | handleOptionWithArgument(String option, String argument)
Callback method for handling an option with an argument.
|
int | parse(String[] argv)
Parse a command line.
|
void | printUsage(OutputStream os)
Print command line usage information to given stream.
|
Parameters: option the option, must start with "-" argumentDesc brief (one or two word) description of the argument description single line description of the option
Parameters: option the option, must start with "-" description single line description of the option
Parameters: option the option, must start with "-" optionExtraPartSynopsis synopsis of the optional extra information description single-line description of the option
Parameters: argv the original command line ignoreComments ignore comments (lines starting with "#") ignoreBlankLines ignore blank lines
Returns: the expanded command line
Parameters: option the option optionExtraPart the "extra" part of the option (everything after the colon: e.g., "withMessages" in "-xml:withMessages"); the empty string if there was no extra part
Parameters: option the option argument the argument
Parameters: argv the arguments
Returns: the number of arguments parsed; if equal to argv.length, then the entire command line was parsed
Throws: HelpRequestedException
Parameters: os the output stream