public class CommandLineParser
extends java.lang.Object
| Constructor and Description |
|---|
CommandLineParser() |
| Modifier and Type | Method and Description |
|---|---|
void |
addOption(java.lang.String name,
java.lang.String description)
Adds a declared option
|
protected DefaultCommandLine |
createCommandLine() |
static CommandLine |
getCurrentCommandLine() |
java.lang.String |
getOptionsHelpMessage() |
CommandLine |
parse(java.lang.String... args)
Parses the given list of command line arguments.
|
CommandLine |
parseString(java.lang.String string)
Parses a string of all the command line options converting them into an array of arguments to pass to #parse(String..args)
|
CommandLine |
parseString(java.lang.String commandName,
java.lang.String args)
Parses a string of all the command line options converting them into an array of arguments to pass to #parse(String..args)
|
protected void |
processOption(DefaultCommandLine cl,
java.lang.String arg) |
protected void |
processSystemArg(DefaultCommandLine cl,
java.lang.String arg) |
public static CommandLine getCurrentCommandLine()
public void addOption(java.lang.String name,
java.lang.String description)
name - The name of the optiondescription - The descriptionpublic CommandLine parseString(java.lang.String string)
string - The stringpublic CommandLine parseString(java.lang.String commandName, java.lang.String args)
commandName - The command nameargs - The stringpublic CommandLine parse(java.lang.String... args)
args - The argumentspublic java.lang.String getOptionsHelpMessage()
protected DefaultCommandLine createCommandLine()
protected void processOption(DefaultCommandLine cl, java.lang.String arg)
protected void processSystemArg(DefaultCommandLine cl, java.lang.String arg)