Short Format
简短样式 POSIX 选项通常只是长格式的同义词。如下所示,选项 --arg
等于 -a
。
Short style POSIX option is usually just a synonym to long format. As
shown below option --arg
is equal to -a
.
-
Programmatic
-
Annotation
-
Legacy Annotation
Unresolved include directive in modules/ROOT/pages/options/short.adoc - include::../../../../src/test/java/org/springframework/shell/docs/ShortOptionSnippets.java[]
Unresolved include directive in modules/ROOT/pages/options/short.adoc - include::../../../../src/test/java/org/springframework/shell/docs/ShortOptionSnippets.java[]
Unresolved include directive in modules/ROOT/pages/options/short.adoc - include::../../../../src/test/java/org/springframework/shell/docs/ShortOptionSnippets.java[]
如果类型定义为标志(这意味着类型是 boolean),则具有组合格式的简短选项十分强大。通过这种方式,您可以将标志的存在定义为 -abc
、-abc true
或 -abc false
Short option with combined format is powerful if type is defined as a flag
which means type is a boolean. That way you can define a presence of a flags
as -abc
, -abc true
or -abc false
.
-
Programmatic
-
Annotation
-
Legacy Annotation
Unresolved include directive in modules/ROOT/pages/options/short.adoc - include::../../../../src/test/java/org/springframework/shell/docs/ShortOptionSnippets.java[]
Unresolved include directive in modules/ROOT/pages/options/short.adoc - include::../../../../src/test/java/org/springframework/shell/docs/ShortOptionSnippets.java[]
Unresolved include directive in modules/ROOT/pages/options/short.adoc - include::../../../../src/test/java/org/springframework/shell/docs/ShortOptionSnippets.java[]