Interface Command
- All Known Implementing Classes:
AbstractCommand, EncodePasswordCommand, HelpCommand, HintCommand, InitCommand, OptionParsingCommand, PromptCommand, ShellCommand, VersionCommand
public interface Command
A single command that can be run from the CLI.
- Since:
- 1.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns a description of the command.@Nullable Collection<HelpExample> Return some examples for the command.@Nullable StringgetHelp()Gets full help text for the command, e.g.getName()Returns the name of the command.Returns help for each supported option.@Nullable StringReturns usage help for the command.Run the command.
-
Method Details
-
getName
-
getDescription
-
getUsageHelp
@Nullable String getUsageHelp()Returns usage help for the command. This should be a simple one-line string describing basic usage. e.g. '[options] <file>'. Do not include the name of the command in this string.- Returns:
- the command's usage help
-
getHelp
@Nullable String getHelp()Gets full help text for the command, e.g. a longer description and one line per option.- Returns:
- the command's help text
-
getOptionsHelp
Collection<OptionHelp> getOptionsHelp()Returns help for each supported option.- Returns:
- help for each of the command's options
-
getExamples
@Nullable Collection<HelpExample> getExamples()Return some examples for the command.- Returns:
- the command's examples
-
run
Run 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
-