|
该版本仍在开发中,尚未被视为稳定。最新稳定版本请使用Spring Shell 3.4.1! |
帮助
运行shell应用通常意味着用户处于图形限制范围内
环境。这就是为什么 shell 命令必须正确自文档化,这也是帮助指挥部进来了。
打字帮助 + 进入列出壳体已知的所有命令(包括不可用的命令)
以及对其职能的简要描述,类似于以下内容:
my-shell:>help
AVAILABLE COMMANDS
Built-In Commands
exit: Exit the shell.
help: Display help about available commands
stacktrace: Display the full stacktrace of the last error.
clear: Clear the shell screen.
quit: Exit the shell.
history: Display or save the history of previously run commands
completion bash: Generate bash completion script
version: Show version info
script: Read and execute commands from a file.
打字Help <command>显示命令的更详细信息,包括可用的参数,以及
类型、是否强制,以及其他细节。
以下列表显示了帮助命令对自身施加:
my-shell:>help help
NAME
help - Display help about available commands
SYNOPSIS
help --command String
OPTIONS
--command or -C String
The command to obtain help for.
[Optional]
帮助是模板化的,必要时可以进行定制。设置在下面spring.shell.command.help你可以在哪里使用启用为了禁用指令,分组模式夺取群或平如果你想通过平整来隐藏群组
一个结构,命令模板为了定义命令输出模板,帮助,命令模板定义
命令列表的输出。
如果spring.shell.command.help.grouping-mode=flat设置好后,帮助将显示:
my-shell:>help help
AVAILABLE COMMANDS
exit: Exit the shell.
help: Display help about available commands
stacktrace: Display the full stacktrace of the last error.
clear: Clear the shell screen.
quit: Exit the shell.
history: Display or save the history of previously run commands
completion bash: Generate bash completion script
version: Show version info
script: Read and execute commands from a file.
输出来自帮助和帮助<commmand>两者都采用了默认实现模板
这些都可以更改。
选择spring.shell.command.help.commands-template默认为classpath:template/help-commands-default.stg且通过GroupsInfoModel作为模特。
选择spring.shell.command.help.command-template默认为classpath:template/help-command-default.stg且通过命令信息模型作为模特。
| 钥匙 | 描述 |
|---|---|
|
|
|
命令变量(参见 GroupCommandInfoModel 变量)。 |
|
命令变量(参见 CommandInfoModel 变量)。 |
|
|
| 钥匙 | 描述 |
|---|---|
|
如果已设置,则为组名。否则,空无一物。 |
|
命令,如果设置好。否则,空无一物。类型是多值,详见 CommandInfoModel 变量。 |
| 钥匙 | 描述 |
|---|---|
|
如果设置了命令名称。否则,无效。类型是字符串,包含完整命令。 |
|
如果设置了命令的名称。否则,无效。类型本质上是多值的 |
|
如果设置了,可能的别名。类型是多值,包含字符串。 |
|
如果设置了命令的描述。否则,无效。 |
|
参数变量,如果已设置。除此之外,空无一物。类型是一个多值,参见 CommandParameterInfoModel 变量。 |
|
可用性变量(参见 CommandAvailabilityInfoModel 变量)。 |
| 钥匙 | 描述 |
|---|---|
|
参数类型如果设置为。否则,无效。 |
|
论点,如果成立。否则,无效。类型是多值,包含字符串。 |
|
|
|
参数的描述,如果设定。否则,无效。 |
|
参数的默认值,如果设置为。否则,无效。 |
|
|
| 钥匙 | 描述 |
|---|---|
|
|
|
如果原因无法获得,且已设定。否则,无效。 |