單一命令
如果您的 shell 應用程式僅為單一目的而設計,且只有一個命令,則為其進行配置可能會很有益處。如果定義了屬性 spring.shell.noninteractive.primary-command
,將會停用 NonInteractiveShellRunner
以外的所有 runner,並將其配置為使用定義的 *主要命令*。
spring:
shell:
noninteractive:
primary-command: mycommand
例如,如果您有一個帶有選項 `arg` 的命令 `mycommand`,則必須使用 `<shellapp> mycommand --arg hi` 執行它,但使用上述設定,可以使用 `<shellapp> --arg hi` 執行它。