48 lines
1.3 KiB
Plaintext
48 lines
1.3 KiB
Plaintext
[[using-shell-options-short]]
|
|
= Short Format
|
|
|
|
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
|
|
|
Short style _POSIX_ option is usually just a synonym to long format. As
|
|
shown below option `--arg` is equal to `-a`.
|
|
|
|
[source,java,indent=0,role="primary"]
|
|
.Programmatic
|
|
----
|
|
include::{snippets}/ShortOptionSnippets.java[tag=option-type-string-programmatic]
|
|
----
|
|
|
|
[source,java,indent=0,role="secondary"]
|
|
.Annotation
|
|
----
|
|
include::{snippets}/ShortOptionSnippets.java[tag=option-type-string-annotation]
|
|
----
|
|
|
|
[source,java,indent=0,role="secondary"]
|
|
.Legacy Annotation
|
|
----
|
|
include::{snippets}/ShortOptionSnippets.java[tag=option-type-string-legacyannotation]
|
|
----
|
|
|
|
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`.
|
|
|
|
[source,java,indent=0,role="primary"]
|
|
.Programmatic
|
|
----
|
|
include::{snippets}/ShortOptionSnippets.java[tag=option-type-multiple-booleans-programmatic]
|
|
----
|
|
|
|
[source,java,indent=0,role="secondary"]
|
|
.Annotation
|
|
----
|
|
include::{snippets}/ShortOptionSnippets.java[tag=option-type-multiple-booleans-annotation]
|
|
----
|
|
|
|
[source,java,indent=0,role="secondary"]
|
|
.Legacy Annotation
|
|
----
|
|
include::{snippets}/ShortOptionSnippets.java[tag=option-type-multiple-booleans-legacyannotation]
|
|
----
|