Add primary command docs

- Backport #755
- Relates #799
This commit is contained in:
Janne Valkealahti
2023-07-05 10:34:17 +01:00
parent 051f7da5dc
commit d86bfed773
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
[[using-shell-customization-singlecommand]]
=== Single Command
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
If your shell application is made for exactly a single purpose having only one
command it may be beneficial to configure it for this. Property
`spring.shell.noninteractive.primary-command` if defined will disable all other
runners than `NonInteractiveShellRunner` and configures it to use
defined _Primary Command_.
====
[source, yaml]
----
spring:
shell:
noninteractive:
primary-command: mycommand
----
====
For example if you have a command `mycommand` with option `arg`
it had to be executed with `<shellapp> mycommand --arg hi`, but with above
setting it can be executed with `<shellapp> --arg hi`.

View File

@@ -8,3 +8,5 @@ include::using-shell-customization-styling.adoc[]
include::using-shell-customization-logging.adoc[]
include::using-shell-customization-commandnotfound.adoc[]
include::using-shell-customization-singlecommand.adoc[]