Expose CommandRegistration in CommandContext

- Fixes #420
This commit is contained in:
Janne Valkealahti
2022-05-18 08:18:38 +01:00
parent b119473881
commit c7d3eb15b4
4 changed files with 43 additions and 8 deletions

View File

@@ -87,4 +87,22 @@ public class FunctionCommands {
.and()
.build();
}
@Bean
public CommandRegistration commandRegistration4() {
return CommandRegistration.builder()
.command("function", "command4")
.help("function sample")
.group("Function Commands")
.withTarget()
.consumer(ctx -> {
ctx.getTerminal().writer()
.println(String.format("hi, command is '%s'", ctx.getCommandRegistration().getCommand()));
})
.and()
.withOption()
.longNames("arg1")
.and()
.build();
}
}