| Modifier and Type | Class and Description |
|---|---|
class |
CLIParser.Command
Bean that represents a parsed command.
|
| Constructor and Description |
|---|
CLIParser(String cliName,
String[] cliHelp)
Create a parser.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCommand(String command,
String argsHelp,
String commandHelp,
org.apache.commons.cli.Options commandOptions,
boolean hasArguments)
Add a command to the parser.
|
CLIParser.Command |
parse(String[] args)
Parse a array of arguments into a command.
|
String |
shortHelp() |
void |
showHelp(org.apache.commons.cli.CommandLine commandLine)
Print the help for the parser to standard output.
|
void |
validdateArgs(String[] args,
String[] minusCommand) |
public void addCommand(String command, String argsHelp, String commandHelp, org.apache.commons.cli.Options commandOptions, boolean hasArguments)
command - comand name.argsHelp - command arguments help.commandHelp - command description.commandOptions - command options.hasArguments - public CLIParser.Command parse(String[] args) throws org.apache.commons.cli.ParseException
args - array of arguments.org.apache.commons.cli.ParseException - thrown if the arguments could not be parsed.public void validdateArgs(String[] args, String[] minusCommand) throws org.apache.commons.cli.ParseException
org.apache.commons.cli.ParseExceptionpublic void showHelp(org.apache.commons.cli.CommandLine commandLine)
commandLine - the command lineCopyright © 2016 Apache Software Foundation. All rights reserved.