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