インタラクションモード
コマンド登録では、シェルが実行しているモードに応じてコマンドを非表示にするために使用される InteractionMode
を定義できます。詳細については、インタラクションモードを参照してください。
CommandRegisration
で定義できます。
CommandRegistration commandRegistration() {
return CommandRegistration.builder()
.command("mycommand")
// can be defined for all modes
.interactionMode(InteractionMode.ALL)
// can be defined only for interactive
.interactionMode(InteractionMode.INTERACTIVE)
// can be defined only for non-interactive
.interactionMode(InteractionMode.NONINTERACTIVE)
.build();
}
または @ShellMethod
。
@ShellMethod(key = "mycommand", interactionMode = InteractionMode.INTERACTIVE)
public void mycommand() {
}