Label

Option Label 本身在 shell 中没有功能行为,只是输出默认 help 命令。在命令文档中会记录选项类型,但这并不总是特别有用。因此您可能想为选项提供更好的描述性单词。

Option Label has no functional behaviour within a shell itself other than what a default help command outputs. Within a command documentation a type of an option is documented but this is not always super useful. Thus you may want to give better descriptive word for an option.

legacy annotation 不支持标签。

Label is not supported with legacy annotation.

  • Programmatic

  • Annotation

Unresolved include directive in modules/ROOT/pages/options/label.adoc - include::../../../../src/test/java/org/springframework/shell/docs/OptionSnippets.java[]
Unresolved include directive in modules/ROOT/pages/options/label.adoc - include::../../../../src/test/java/org/springframework/shell/docs/OptionSnippets.java[]

然后在 help 中显示定义的标签。

Defining label is then shown in help.

my-shell:>help labelOption
NAME
       labelOption -

SYNOPSIS
       labelOption --arg MYLABEL

OPTIONS
       --arg MYLABEL
       [Optional]