java.lang.Object
org.elasticsearch.cli.Command
org.elasticsearch.cli.MultiCommand
- All Implemented Interfaces:
Closeable
,AutoCloseable
A cli tool which is made up of multiple subcommands.
-
Field Summary
FieldsFields inherited from class org.elasticsearch.cli.Command
description, parser
-
Constructor Summary
ConstructorsConstructorDescriptionMultiCommand
(String description) Construct the multi-command with the specified command description and runnable to execute before main is invoked. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
execute
(Terminal terminal, joptsimple.OptionSet options, ProcessInfo processInfo) Executes this command.protected void
printAdditionalHelp
(Terminal terminal) Prints additional help information, specific to the commandprotected void
printUserException
(Terminal terminal, UserException e) Methods inherited from class org.elasticsearch.cli.Command
exit, main, mainWithoutErrorHandling, parseOptions
-
Field Details
-
subcommands
-
-
Constructor Details
-
MultiCommand
Construct the multi-command with the specified command description and runnable to execute before main is invoked.- Parameters:
description
- the multi-command description
-
-
Method Details
-
printAdditionalHelp
Description copied from class:Command
Prints additional help information, specific to the command- Overrides:
printAdditionalHelp
in classCommand
-
printUserException
- Overrides:
printUserException
in classCommand
-
execute
protected void execute(Terminal terminal, joptsimple.OptionSet options, ProcessInfo processInfo) throws Exception Description copied from class:Command
Executes this command. Any runtime user errors (like an input file that does not exist), should throw aUserException
. -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classCommand
- Throws:
IOException
-