Update docs
This commit is contained in:
@@ -26,20 +26,20 @@
|
||||
*** xref:using-shell-commands-builtin-completion.adoc[]
|
||||
*** xref:using-shell-commands-builtin-version.adoc[]
|
||||
** xref:using-shell-commands-writing.adoc[]
|
||||
* xref:using-shell-options.adoc[]
|
||||
** xref:using-shell-options-basics.adoc[]
|
||||
*** xref:using-shell-options-basics-programmatic.adoc[]
|
||||
*** xref:using-shell-options-basics-annotation.adoc[]
|
||||
*** xref:using-shell-options-basics-legacyannotation.adoc[]
|
||||
** xref:using-shell-options-short.adoc[]
|
||||
** xref:using-shell-options-arity.adoc[]
|
||||
** xref:using-shell-options-positional.adoc[]
|
||||
** xref:using-shell-options-optional.adoc[]
|
||||
** xref:using-shell-options-default.adoc[]
|
||||
** xref:using-shell-options-validation.adoc[]
|
||||
** xref:using-shell-options-label.adoc[]
|
||||
** xref:using-shell-options-types.adoc[]
|
||||
** xref:using-shell-options-naming.adoc[]
|
||||
* xref:options/index.adoc[]
|
||||
** xref:options/basics/index.adoc[]
|
||||
*** xref:options/basics/programmatic.adoc[]
|
||||
*** xref:options/basics/annotation.adoc[]
|
||||
*** xref:options/basics/legacyannotation.adoc[]
|
||||
** xref:options/short.adoc[]
|
||||
** xref:options/arity.adoc[]
|
||||
** xref:options/positional.adoc[]
|
||||
** xref:options/optional.adoc[]
|
||||
** xref:options/default.adoc[]
|
||||
** xref:options/validation.adoc[]
|
||||
** xref:options/label.adoc[]
|
||||
** xref:options/types.adoc[]
|
||||
** xref:options/naming.adoc[]
|
||||
* xref:using-shell-completion.adoc[]
|
||||
* xref:using-shell-building.adoc[]
|
||||
* xref:using-shell-components.adoc[]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-options-arity]]
|
||||
= Arity
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
Arity defines how many parameters option parsing takes.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
= Annotation
|
||||
:page-section-summary-toc: 1
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
`Option` annotation can be used to define an option name if you
|
||||
don't want it to be same as argument name.
|
||||
@@ -2,7 +2,7 @@
|
||||
= Basics
|
||||
:page-section-summary-toc: 1
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
This section gives a generic idea how an option can be defined. Following
|
||||
sections, beyond basics, discuss more about how various option behaviour
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-options-basics-legacyannotation]]
|
||||
= Legacy Annotation
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
Having a target method with argument is automatically registered with a matching
|
||||
argument name.
|
||||
@@ -3,7 +3,7 @@
|
||||
= Programmatic
|
||||
:page-section-summary-toc: 1
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
Programmatic way with `CommandRegistration` is to use `withOption` to define
|
||||
an option.
|
||||
@@ -1,10 +1,10 @@
|
||||
[[using-shell-options-default]]
|
||||
= Default Value
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
Having a default value for an option is somewhat related to
|
||||
xref:using-shell-options-optional.adoc[Optional Value], as there are cases where you
|
||||
xref:options/optional.adoc[Optional Value], as there are cases where you
|
||||
may want to know if the user defined an option and change behavior
|
||||
based on a default value:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-options]]
|
||||
= Options
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
Command line arguments can be separated into options and positional parameters.
|
||||
Following sections describes features how options are defined and used. We first
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-options-label]]
|
||||
= Label
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
_Option Label_ has no functional behaviour within a shell itself other than
|
||||
what a default `help` command outputs. Within a command documentation
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-options-naming]]
|
||||
= Naming
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
If there is a need to modify option long names that can be done
|
||||
using `OptionNameModifier` interface which is a simple
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-options-optional]]
|
||||
= Optional Value
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
An option is either required or not and, generally speaking, how it behaves depends on
|
||||
a command target.
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-options-positional]]
|
||||
= Positional
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
Positional information is mostly related to a command target method:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-options-short]]
|
||||
= Short Format
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../src/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`.
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-options-types]]
|
||||
= Types
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
This section talks about how particular data type is used as an option value.
|
||||
|
||||
Reference in New Issue
Block a user