单命令

如果您的 shell 应用程序仅用于一个单一目的,只有一个命令,那么将其配置为此目的可能会很有用。 如果定义了属性 spring.shell.noninteractive.primary-command,它将禁用除 NonInteractiveShellRunner 之外的所有其他运行程序,并将其配置为使用定义的主要命令

spring:
  shell:
    noninteractive:
      primary-command: mycommand

例如,如果您有一个带有选项 arg 的命令 mycommand,则必须使用 <shellapp> mycommand --arg hi 执行它,但是使用上面的设置,可以使用 <shellapp> --arg hi 执行它。