Package io.vertx.ext.shell.command
Interface Command
-
public interface CommandA Vert.x Shell command, it can be created from any language using theCommandBuilder.command(java.lang.String)or from a Java class usingcreate(io.vertx.core.Vertx, java.lang.Class<? extends io.vertx.ext.shell.command.AnnotatedCommand>)- Author:
- Julien Viet
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CLIcli()default voidcomplete(Completion completion)Perform command completion, when the command is done completing it should callCompletion.complete(List)orCompletion.complete(String, boolean))} method to signal completion is done.static Commandcreate(Vertx vertx, Class<? extends AnnotatedCommand> clazz)Create a command from a Java class, annotated with Vert.x Core CLI annotations.default ProcesscreateProcess()Create a new process with empty arguments.ProcesscreateProcess(List<CliToken> args)Create a new process with the passed arguments.default Stringname()
-
-
-
Method Detail
-
create
static Command create(Vertx vertx, Class<? extends AnnotatedCommand> clazz)
Create a command from a Java class, annotated with Vert.x Core CLI annotations.- Parameters:
vertx- the vertx instanceclazz- the class of the command- Returns:
- the command object
-
name
default String name()
- Returns:
- the command name
-
cli
default CLI cli()
- Returns:
- the command line interface, can be null
-
createProcess
default Process createProcess()
Create a new process with empty arguments.- Returns:
- the process
-
createProcess
Process createProcess(List<CliToken> args)
Create a new process with the passed arguments.- Parameters:
args- the process arguments- Returns:
- the process
-
complete
default void complete(Completion completion)
Perform command completion, when the command is done completing it should callCompletion.complete(List)orCompletion.complete(String, boolean))} method to signal completion is done.- Parameters:
completion- the completion object
-
-