public abstract class OptionParsingCommand extends AbstractCommand
Command
that parse options using an OptionHandler
.OptionHandler
Modifier | Constructor and Description |
---|---|
protected |
OptionParsingCommand(java.lang.String name,
java.lang.String description,
OptionHandler handler) |
Modifier and Type | Method and Description |
---|---|
protected OptionHandler |
getHandler() |
java.lang.String |
getHelp()
Gets full help text for the command, e.g.
|
java.util.Collection<OptionHelp> |
getOptionsHelp()
Returns help for each supported option.
|
ExitStatus |
run(java.lang.String... args)
Run the command.
|
getDescription, getExamples, getName, getUsageHelp
protected OptionParsingCommand(java.lang.String name, java.lang.String description, OptionHandler handler)
public java.lang.String getHelp()
Command
getHelp
in interface Command
getHelp
in class AbstractCommand
public java.util.Collection<OptionHelp> getOptionsHelp()
Command
getOptionsHelp
in interface Command
getOptionsHelp
in class AbstractCommand
public final ExitStatus run(java.lang.String... args) throws java.lang.Exception
Command
args
- command arguments (this will not include the command itself)java.lang.Exception
- if the command failsprotected OptionHandler getHandler()