Files
spring-shell/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-commandcontext.adoc
2023-08-03 15:25:32 -05:00

20 lines
491 B
Plaintext

[[command-context]]
= Command Context
:page-section-summary-toc: 1
The `CommandContext` interface gives access to a currently running
context. You can use it to get access to options:
[source, java, indent=0]
----
include::{snippets}/CommandContextSnippets.java[tag=snippet1]
----
If you need to print something into a shell, you can get a `Terminal`
and use its writer to print something:
[source, java, indent=0]
----
include::{snippets}/CommandContextSnippets.java[tag=snippet2]
----