This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Shell 3.4.0! |
Interaction Mode
Command registration can define InteractionMode
which is used to hide commands
depending on which mode the shell is executing in. More about that in Interaction Mode.
You can define the interaction mode with 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();
}
Or with @ShellMethod
.
@ShellMethod(key = "mycommand", interactionMode = InteractionMode.INTERACTIVE)
public void mycommand() {
}