Package org.elasticsearch.cli
Class MultiCommand
java.lang.Object
org.elasticsearch.cli.Command
org.elasticsearch.cli.MultiCommand
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class MultiCommand extends Command
A cli tool which is made up of multiple subcommands.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,Command>subcommandsFields inherited from class org.elasticsearch.cli.Command
description, parser -
Constructor Summary
Constructors Constructor Description MultiCommand(java.lang.String description, java.lang.Runnable beforeMain)Construct the multi-command with the specified command description and runnable to execute before main is invoked. -
Method Summary
Modifier and Type Method Description voidclose()protected voidexecute(Terminal terminal, joptsimple.OptionSet options)Executes this command.protected voidprintAdditionalHelp(Terminal terminal)Prints additional help information, specific to the commandMethods inherited from class org.elasticsearch.cli.Command
addShutdownHook, exit, mainMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
subcommands
-
-
Constructor Details
-
MultiCommand
public MultiCommand(java.lang.String description, java.lang.Runnable beforeMain)Construct the multi-command with the specified command description and runnable to execute before main is invoked.- Parameters:
description- the multi-command descriptionbeforeMain- the before-main runnable
-
-
Method Details
-
printAdditionalHelp
Description copied from class:CommandPrints additional help information, specific to the command- Overrides:
printAdditionalHelpin classCommand
-
execute
Description copied from class:CommandExecutes this command. Any runtime user errors (like an input file that does not exist), should throw aUserException. -
close
public void close() throws java.io.IOException
-