/** * Set the command completion handler, the completion handler when the user asks for contextual command line * completion, usually hitting the <i>tab</i> key. * @param handler the completion handler * @return this command object */ public io.vertx.rxjava.ext.shell.command.CommandBuilder completionHandler(Handler<io.vertx.rxjava.ext.shell.cli.Completion> handler) { delegate.completionHandler(new Handler<io.vertx.ext.shell.cli.Completion>() { public void handle(io.vertx.ext.shell.cli.Completion event) { handler.handle(io.vertx.rxjava.ext.shell.cli.Completion.newInstance(event)); } }); return this; }
/** * Set the command completion handler, the completion handler when the user asks for contextual command line * completion, usually hitting the <i>tab</i> key. * @param handler the completion handler * @return this command object */ public io.vertx.rxjava.ext.shell.command.CommandBuilder completionHandler(Handler<io.vertx.rxjava.ext.shell.cli.Completion> handler) { delegate.completionHandler(new Handler<io.vertx.ext.shell.cli.Completion>() { public void handle(io.vertx.ext.shell.cli.Completion event) { handler.handle(io.vertx.rxjava.ext.shell.cli.Completion.newInstance(event)); } }); return this; }
@Before public void before(TestContext context) { registry = CommandRegistry.getShared(rule.vertx()); registry.registerCommand(CommandBuilder.command("foo").processHandler(proc -> { }).completionHandler( completion -> { completion.complete("completed_by_foo", false); } ).build(rule.vertx()), context.asyncAssertSuccess(v1 -> { registry.registerCommand(CommandBuilder.command("bar").processHandler(proc -> { }).build(rule.vertx()), context.asyncAssertSuccess(v2 -> { registry.registerCommand(CommandBuilder.command("baz").processHandler(proc -> { }).build(rule.vertx()), context.asyncAssertSuccess(v3 -> { registry.registerCommand(CommandBuilder.command("err").processHandler(proc -> { }).completionHandler(completion -> { throw new RuntimeException("expected"); }).build(rule.vertx()), context.asyncAssertSuccess()); })); })); })); mgr = new InternalCommandManager(registry); }