Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jvalkeal committed Oct 6, 2023
1 parent 1417e33 commit 825db92
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 28 deletions.
28 changes: 14 additions & 14 deletions spring-shell-docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.

Expand Down

0 comments on commit 825db92

Please sign in to comment.