Class OptionParsingCommand
java.lang.Object
org.springframework.boot.cli.command.AbstractCommand
org.springframework.boot.cli.command.OptionParsingCommand
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
EncodePasswordCommand,GrabCommand,InitCommand,InstallCommand,JarCommand,RunCommand,UninstallCommand,WarCommand
Base class for a
Command that parse options using an OptionHandler.- Since:
- 1.0.0
- Author:
- Phillip Webb, Dave Syer
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOptionParsingCommand(String name, String description, OptionHandler handler) -
Method Summary
Modifier and TypeMethodDescriptionprotected OptionHandlergetHelp()Gets full help text for the command, e.g.Returns help for each supported option.final ExitStatusRun the command.Methods inherited from class org.springframework.boot.cli.command.AbstractCommand
getDescription, getExamples, getName, getUsageHelp
-
Constructor Details
-
OptionParsingCommand
-
-
Method Details
-
getHelp
Description copied from interface:CommandGets full help text for the command, e.g. a longer description and one line per option.- Specified by:
getHelpin interfaceCommand- Overrides:
getHelpin classAbstractCommand- Returns:
- the command's help text
-
getOptionsHelp
Description copied from interface:CommandReturns help for each supported option.- Specified by:
getOptionsHelpin interfaceCommand- Overrides:
getOptionsHelpin classAbstractCommand- Returns:
- help for each of the command's options
-
run
Description copied from interface:CommandRun the command.- Parameters:
args- command arguments (this will not include the command itself)- Returns:
- the outcome of the command
- Throws:
Exception- if the command fails
-
getHandler
-