Files
Mahmoud Ben Hassine e3cb93791d Update documentation
2025-04-25 10:13:56 +02:00

23 lines
718 B
Plaintext

[[commands-interactionmode]]
= Interaction Mode
:page-section-summary-toc: 1
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]
Command registration can define `InteractionMode` which is used to hide commands
depending on which mode the shell is executing in. More about that in xref:execution.adoc#using-shell-execution-interactionmode[Interaction Mode].
You can define the interaction mode with `CommandRegisration`:
[source, java, indent=0]
----
include::{snippets}/CommandRegistrationInteractionModeSnippets.java[tag=snippet1]
----
Or with `@ShellMethod`.
[source, java, indent=0]
----
include::{snippets}/CommandRegistrationInteractionModeSnippets.java[tag=snippet2]
----