diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-debugging.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-debugging.adoc index d78b03c7..17aecaaf 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-debugging.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-debugging.adoc @@ -1,5 +1,5 @@ [appendix] [#appendix-debugging] -== Debugging += Debugging Please find more info about debugging from https://github.com/spring-projects/spring-shell/wiki/Debugging[project wiki]. diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-commandcatalog.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-commandcatalog.adoc index d5baabb4..a4b292a9 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-commandcatalog.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-commandcatalog.adoc @@ -1,5 +1,6 @@ [[command-catalog]] -=== Command Catalog += Command Catalog + The `CommandCatalog` interface defines how command registrations exist in a shell application. It is possible to dynamically register and de-register commands, which gives flexibility for use cases where possible commands @@ -13,7 +14,7 @@ include::{snippets}/CommandCatalogSnippets.java[tag=snippet1] ==== [[command-resolver]] -==== Command Resolver +== Command Resolver You can implement the `CommandResolver` interface and define a bean to dynamically resolve mappings from a command's name to its `CommandRegistration` instances. Consider the following example: @@ -30,7 +31,7 @@ Thus, we advise not using it if a command resolution call takes a long time, as make the shell feel sluggish. [[command-catalog-customizer]] -==== Command Catalog Customizer +== Command Catalog Customizer You can use the `CommandCatalogCustomizer` interface to customize a `CommandCatalog`. Its main use is to modify a catalog. Also, within `spring-shell` auto-configuration, this interface is used to register existing `CommandRegistration` beans into a catalog. diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-commandcontext.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-commandcontext.adoc index c0113475..047d5d57 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-commandcontext.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-commandcontext.adoc @@ -1,5 +1,6 @@ [[command-context]] -=== Command Context += Command Context + The `CommandContext` interface gives access to a currently running context. You can use it to get access to options: diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-execution.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-execution.adoc index c536a1d2..87196ee9 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-execution.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-execution.adoc @@ -1,4 +1,5 @@ [[command-execution]] -=== Command Execution += Command Execution + When command parsing has done its job and command registration has been resolved, command execution does the hard work of running the code. diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-parser.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-parser.adoc index 57a79d74..c81b3879 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-parser.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-parser.adoc @@ -1,4 +1,5 @@ [[command-parser]] -=== Command Parser += Command Parser + Before a command can be executed, we need to parse the command and whatever options the user may have provided. Parsing comes between command registration and command execution. diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-registration.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-registration.adoc index ff523a50..104a84e0 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-registration.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-registration.adoc @@ -1,5 +1,6 @@ [#appendix-tech-intro-registration] -=== Command Registration += Command Registration + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Defining a command registration is a first step to introducing the structure of a command and its options @@ -7,7 +8,7 @@ and parameters. This is loosely decoupled from what happens later, such as parsi actual target code. Essentially, it is the definition of a command API that is shown to a user. [[commands]] -==== Commands +== Commands A command in a `spring-shell` structure is defined as an array of commands. This yields a structure similar to the following example: @@ -25,7 +26,7 @@ NOTE: We do not currently support mapping commands to an explicit parent if sub- For example, `command1 sub1` and `command1 sub1 subsub1` cannot both be registered. [[interaction-mode]] -==== Interaction Mode +== Interaction Mode Spring Shell has been designed to work on two modes: interactive (which essentially is a `REPL` where you have an active shell instance throughout a series of commands) and non-interactive (where commands are executed one by one from a command line). @@ -39,7 +40,7 @@ Also, being on an active `REPL` session may provide more information about what doing within an active session. [[options]] -==== Options +== Options Options can be defined as long and short, where the prefixing is `--` and `-`, respectively. The following examples show long and short options: @@ -58,12 +59,12 @@ include::{snippets}/CommandRegistrationSnippets.java[tag=snippet2] ==== [[target]] -==== Target +== Target The target defines the execution target of a command. It can be a method in a POJO, a `Consumer`, or a `Function`. [[method]] -===== Method +=== Method Using a `Method` in an existing POJO is one way to define a target. Consider the following class: @@ -84,7 +85,7 @@ include::{snippets}/CommandTargetSnippets.java[tag=snippet12] ==== [[function]] -===== Function +=== Function Using a `Function` as a target gives a lot of flexibility to handle what happens in a command execution, because you can handle many things manually by using a `CommandContext` given to a `Function`. The return type from a `Function` is @@ -98,7 +99,7 @@ include::{snippets}/CommandTargetSnippets.java[tag=snippet2] ==== [[consumer]] -===== Consumer +=== Consumer Using a `Consumer` is basically the same as using a `Function`, with the difference being that there is no return type. If you need to print something into a shell, you can get a reference to a `Terminal` from a context and print something diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-searchalgorithm.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-searchalgorithm.adoc index 28d77fcb..0f6c43b2 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-searchalgorithm.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-searchalgorithm.adoc @@ -1,5 +1,6 @@ [#appendix-tech-intro-searchalgorithm] -=== Search Algorithms += Search Algorithms + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] `SearchMatch` is an interface to match _text_ with a _pattern_. Match @@ -9,7 +10,7 @@ contains info about match positions and overall score of a match. https://github.com/junegunn/fzf[fzf]. [[implementations]] -==== Implementations +== Implementations *FuzzyMatchV2Search* @@ -22,7 +23,7 @@ Port of _fzf ExactMatchNaive_ algorithm. Simple exact match works more accuratel if you know what to search. [[searchmatch]] -==== SearchMatch +== SearchMatch Algorithms and default syntax are hidden inside package protected classes as we don't want to fully open these until we know API's are good to go @@ -58,7 +59,7 @@ below table. |=== [[examples]] -==== Examples +== Examples ==== [source, java, indent=0] diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-theming.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-theming.adoc index 15e4989b..971aa81b 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-theming.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro-theming.adoc @@ -1,5 +1,6 @@ [#appendix-tech-intro-theming] -=== Theming += Theming + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Styling in a theming is provided by a use of a _AttributedString_ from `JLine`. diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro.adoc index cf835df2..5265ecbd 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-techical-intro.adoc @@ -1,6 +1,7 @@ [appendix] [#appendix-tech-intro] -== Techical Introduction += Techical Introduction + This appendix contains information for developers and others who would like to know more about how Spring Shell works internally and what its design decisions are. diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-tui-catalog.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-tui-catalog.adoc index d218fc28..700d387f 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-tui-catalog.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-tui-catalog.adoc @@ -1,5 +1,6 @@ [#appendix-tui-catalog] -=== Catalog App += Catalog App + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Catalog application is showing various ways how Terminal UI Framework can be used. @@ -8,6 +9,6 @@ a reference application as it's using most of the features available and tries to follow best practices. [[create-scenario]] -==== Create Scenario +== Create Scenario Every `Scenario` essentially is a sample code of a `View` as that's what catalog app demonstrates. diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-tui-control.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-tui-control.adoc index 021b30a2..971648e8 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-tui-control.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-tui-control.adoc @@ -1,5 +1,6 @@ [#appendix-tui-control] -=== Control += Control + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] _Control_ draws something into a screen with a given bounds. diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-tui-eventloop.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-tui-eventloop.adoc index 80d49f38..e2cbb90a 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-tui-eventloop.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-tui-eventloop.adoc @@ -1,5 +1,6 @@ [#appendix-tui-eventloop] -=== EventLoop += EventLoop + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] _EventLoop_ is a central system handling eventing in a framework. diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-tui-keyhandling.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-tui-keyhandling.adoc index 5f999c51..13ff643b 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-tui-keyhandling.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-tui-keyhandling.adoc @@ -1,5 +1,6 @@ [#appendix-tui-keyhandling] -=== Key Handling += Key Handling + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Handles incoming key events. diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-tui-mousehandling.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-tui-mousehandling.adoc index 5fba7f7a..719356fd 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-tui-mousehandling.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-tui-mousehandling.adoc @@ -1,5 +1,6 @@ [#appendix-tui-mousehandling] -=== Mouse Handling += Mouse Handling + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Handles incoming mouse events. diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-tui-screen.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-tui-screen.adoc index 6b38905a..4f043cb6 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-tui-screen.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-tui-screen.adoc @@ -1,5 +1,6 @@ [#appendix-tui-screen] -=== Screen += Screen + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] _Screen_ is an abstraction providing higher level concept to draw something diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-tui-view.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-tui-view.adoc index bc83a5ae..cfad13e0 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-tui-view.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-tui-view.adoc @@ -1,5 +1,6 @@ [#appendix-tui-view] -=== View += View + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] _View_ extends _Control_ providing integration into event loop. diff --git a/spring-shell-docs/modules/ROOT/pages/appendices-tui.adoc b/spring-shell-docs/modules/ROOT/pages/appendices-tui.adoc index 0ffe605f..33a00e7c 100644 --- a/spring-shell-docs/modules/ROOT/pages/appendices-tui.adoc +++ b/spring-shell-docs/modules/ROOT/pages/appendices-tui.adoc @@ -1,6 +1,7 @@ [appendix] [#appendix-tech-intro-tui] -== Terminal UI += Terminal UI + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] This is a technical introduction to _UI Framework_. diff --git a/spring-shell-docs/modules/ROOT/pages/getting-started.adoc b/spring-shell-docs/modules/ROOT/pages/getting-started.adoc index c9567d45..25003f3c 100644 --- a/spring-shell-docs/modules/ROOT/pages/getting-started.adoc +++ b/spring-shell-docs/modules/ROOT/pages/getting-started.adoc @@ -1,5 +1,6 @@ [[getting-started]] -== Getting Started += Getting Started + To see what Spring Shell has to offer, we can write a trivial _hello world_ shell application that has a simple argument. @@ -7,7 +8,7 @@ IMPORTANT: _Spring Shell_ is based on _Spring Boot_ {spring-boot-version} and _Spring Framework_ {spring-version} and thus requires _JDK 17_. [[creating-a-project]] -=== Creating a Project +== Creating a Project For the purpose of this tutorial, we create a simple Spring Boot application by using https://start.spring.io where you can choose _Spring Shell_ dependency. @@ -98,7 +99,7 @@ TIP: Check out <> making logging to work better with shell apps. [[using-spring-shell-your-first-command]] -=== Your First Command +== Your First Command Now we can add our first command. To do so, create a new class (named whatever you want) and annotate it with `@ShellComponent` which is a variation of `@Component` that is used to restrict diff --git a/spring-shell-docs/modules/ROOT/pages/introduction.adoc b/spring-shell-docs/modules/ROOT/pages/introduction.adoc index 41e550bc..cee5b522 100644 --- a/spring-shell-docs/modules/ROOT/pages/introduction.adoc +++ b/spring-shell-docs/modules/ROOT/pages/introduction.adoc @@ -1,5 +1,6 @@ [[what-is-spring-shell?]] -== What is Spring Shell? += What is Spring Shell? + Not all applications need a fancy web user interface. Sometimes, interacting with an application through an interactive terminal is the most appropriate way to get things done. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-basics-reading.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-basics-reading.adoc index 3a3b28cf..2c12ce62 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-basics-reading.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-basics-reading.adoc @@ -1,5 +1,5 @@ [[using-shell-basics-reading]] -=== Reading Docs += Reading Docs Throughout this documentation, we make references to configuring something by using annotations or programmatic examples. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-basics.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-basics.adoc index 39c83693..e9518522 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-basics.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-basics.adoc @@ -1,5 +1,6 @@ [[using-shell-basics]] -== Basics += Basics + This section covers the basics of Spring Shell. Before going on to define actual commands and options, we need to go through some of the fundamental concepts of Spring Shell. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-building.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-building.adoc index 0077819d..2898eecb 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-building.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-building.adoc @@ -1,10 +1,10 @@ [[using-shell-building]] -== Building += Building This section covers how to build a Spring Shell application. [[native]] -=== Native Support +== Native Support Support for compiling _Spring Shell_ application into a _GraalVM_ binary mostly comes from _Spring Framework_ and _Spring Boot_ where feature is diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-availability.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-availability.adoc index 95d53721..1eb46ac4 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-availability.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-availability.adoc @@ -1,5 +1,5 @@ [[dynamic-command-availability]] -=== Dynamic Command Availability += Dynamic Command Availability Registered commands do not always make sense, due to the internal state of the application. For example, there may be a `download` command, but it only works once the user has used `connect` on a remote diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-clear.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-clear.adoc index f335f39f..1ede6f0a 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-clear.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-clear.adoc @@ -1,4 +1,5 @@ [[built-in-commands-clear]] -==== Clear += Clear + The `clear` command does what you would expect and clears the screen, resetting the prompt in the top left corner. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-completion.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-completion.adoc index e933aefe..c0a31e1f 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-completion.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-completion.adoc @@ -1,5 +1,5 @@ [[built-in-commands-completion]] -==== Completion += Completion The `completion` command set lets you create script files that can be used with am OS shell implementations to provide completion. This is very useful when diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-exit.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-exit.adoc index bb380f37..90b262b5 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-exit.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-exit.adoc @@ -1,5 +1,5 @@ [[built-in-commands-exit]] -==== Exit += Exit The `quit` command (also aliased as `exit`) requests the shell to quit, gracefully closing the Spring application context. If not overridden, a JLine `History` bean writes a history of all diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-help.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-help.adoc index 162234ab..0b96be1d 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-help.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-help.adoc @@ -1,5 +1,5 @@ [[built-in-commands-help]] -==== Help += Help Running a shell application often implies that the user is in a graphically limited environment. Also, while we are nearly always connected in the era of mobile phones, diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-history.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-history.adoc index 0e79d5cf..edb2a715 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-history.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-history.adoc @@ -1,5 +1,5 @@ [[built-in-commands-history]] -==== History += History The `history` command shows the history of commands that has been executed. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-script.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-script.adoc index b87416af..da5c4c7f 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-script.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-script.adoc @@ -1,5 +1,5 @@ [[built-in-commands-script]] -==== Script += Script The `script` command accepts a local file as an argument and replays commands found there, one at a time. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-stacktrace.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-stacktrace.adoc index ba9684ba..19e66079 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-stacktrace.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-stacktrace.adoc @@ -1,5 +1,5 @@ [[built-in-commands-stacktrace]] -==== Stacktrace += Stacktrace When an exception occurs inside command code, it is caught by the shell and a simple, one-line message is displayed so as not to overflow the user with too much information. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-version.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-version.adoc index dc8339e6..6c0c3ff4 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-version.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin-version.adoc @@ -1,5 +1,5 @@ [[built-in-commands-version]] -==== Version += Version The `version` command shows existing build and git info by integrating into Boot's `BuildProperties` and `GitProperties` if those exist in the shell application. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin.adoc index f8aabfbc..09080881 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-builtin.adoc @@ -1,5 +1,5 @@ [[built-in-commands]] -=== Built-In Commands += Built-In Commands include::using-shell-commands-builtin-help.adoc[] diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling-annotation.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling-annotation.adoc index 50ea998b..bb34493c 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling-annotation.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling-annotation.adoc @@ -1,5 +1,6 @@ [[dynamic-command-exitcode-annotation]] -==== @ExceptionResolver += @ExceptionResolver + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] `@ShellComponent` classes can have `@ExceptionResolver` methods to handle exceptions from component @@ -53,7 +54,7 @@ include::{snippets}/ErrorHandlingSnippets.java[tag=exception-resolver-with-void] ==== [[method-arguments]] -===== Method Arguments +== Method Arguments `@ExceptionResolver` methods support the following arguments: [Attributes] @@ -69,7 +70,7 @@ include::{snippets}/ErrorHandlingSnippets.java[tag=exception-resolver-with-void] |=== [[return-values]] -===== Return Values +== Return Values `@ExceptionResolver` methods support the following return values: [Attributes] diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling-mappings.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling-mappings.adoc index 951e9f2b..d8dd034f 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling-mappings.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling-mappings.adoc @@ -1,5 +1,6 @@ [[dynamic-command-exitcode-mappings]] -==== Exit Code Mappings += Exit Code Mappings + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Default behaviour of an exit codes is as: diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling-resolving.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling-resolving.adoc index eb4998bb..19f01f0c 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling-resolving.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling-resolving.adoc @@ -1,5 +1,6 @@ [[dynamic-command-exitcode-resolving]] -==== Exception Resolving += Exception Resolving + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Unhandled exceptions will bubble up into shell's `ResultHandlerService` and then eventually diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling.adoc index 60b7b867..d1c220bb 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-exceptionhandling.adoc @@ -1,5 +1,6 @@ [[dynamic-command-exitcode]] -=== Exception Handling += Exception Handling + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Exceptions happen from a user code wether it is intentional or not. This section describes diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-helpoptions.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-helpoptions.adoc index a3418782..e063dff9 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-helpoptions.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-helpoptions.adoc @@ -1,5 +1,6 @@ [[commands-helpoptions]] -=== Help Options += Help Options + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] _Spring Shell_ has a build-in `help` command but not all favour getting command help diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-hidden.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-hidden.adoc index f0a75950..a7b87c6e 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-hidden.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-hidden.adoc @@ -1,5 +1,6 @@ [[commands-hidden]] -=== Hidden Command += Hidden Command + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] It is possible to _hide_ a command which is convenient in cases where it is not yet ready for diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-interactionmode.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-interactionmode.adoc index fd3d7fd5..44a98843 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-interactionmode.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-interactionmode.adoc @@ -1,5 +1,6 @@ [[commands-interactionmode]] -=== Interaction Mode += Interaction Mode + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Command registration can define `InteractionMode` which is used to hide commands diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-organize.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-organize.adoc index 1f4041af..892a5f35 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-organize.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-organize.adoc @@ -1,5 +1,5 @@ [[organizing-commands]] -=== Organizing Commands += Organizing Commands When your shell starts to provide a lot of functionality, you may end up with a lot of commands, which could be confusing for your users. By typing `help`, diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration-annotation.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration-annotation.adoc index e8772b00..13255e9d 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration-annotation.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration-annotation.adoc @@ -1,5 +1,6 @@ [[commands-registration-annotation]] -==== Annotation += Annotation + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] `@Command` annotation when used on a method marks it as a candidate for command registration. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration-legacyannotation.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration-legacyannotation.adoc index cded0907..d56ce131 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration-legacyannotation.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration-legacyannotation.adoc @@ -1,5 +1,6 @@ [[commands-registration-legacyannotation]] -==== Legacy Annotation += Legacy Annotation + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] When you use the standard API, methods on beans are turned into executable commands, provided that: diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration-programmatic.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration-programmatic.adoc index ad7b8a2a..79d6ef08 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration-programmatic.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration-programmatic.adoc @@ -1,5 +1,6 @@ [[commands-registration-programmatic]] -==== Programmatic += Programmatic + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] In the programmatic model, `CommandRegistration` can be defined as a `@Bean` diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration.adoc index 4675dfcd..1b9bcb9d 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-registration.adoc @@ -1,5 +1,6 @@ [[registration]] -=== Registration += Registration + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] There are two different ways to define a command: through an annotation model and diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-writing.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-writing.adoc index 99a35c95..71783e80 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands-writing.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands-writing.adoc @@ -1,5 +1,6 @@ [[writing]] -=== Writing += Writing + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] When something needs to get written into your console you can always diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-commands.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-commands.adoc index 00c3fc48..e8da23dc 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-commands.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-commands.adoc @@ -1,5 +1,6 @@ [[commands]] -== Commands += Commands + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] In this section, we go through an actual command registration and leave command options diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-completion.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-completion.adoc index 45e0c76d..4e0c36a2 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-completion.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-completion.adoc @@ -1,5 +1,6 @@ [[completion]] -== Completion += Completion + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Spring Shell can provide completion proposals for both interactive shell @@ -10,7 +11,7 @@ When shell is purely run as a command-line tool a completion can only be accomplished with integration into OS level shell's like _bash_. [[interactive]] -=== Interactive +== Interactive Hints for completions are calculated with _function_ or _interface_ style methods which takes `CompletionContext` and returns a list of @@ -61,7 +62,7 @@ include::{snippets}/CompletionSnippets.java[tag=anno-method] ==== [[command-line]] -=== Command-Line +== Command-Line Command-line completion currently only support _bash_ and is documented in a built-in `completion` command <>. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-components-flow.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-components-flow.adoc index abeb57fe..21d74d54 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-components-flow.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-components-flow.adoc @@ -1,5 +1,6 @@ [[using-shell-components-flow]] -=== Flow += Flow + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] When you use <> to build something that involves diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-confirmation.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-confirmation.adoc index 92886c76..d213fcc5 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-confirmation.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-confirmation.adoc @@ -1,5 +1,6 @@ [[using-shell-components-ui-confirmation]] -==== Confirmation += Confirmation + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] The confirmation component asks a user for a simple confirmation. It is essentially a diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-multiselect.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-multiselect.adoc index c2385466..9cc57a3e 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-multiselect.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-multiselect.adoc @@ -1,5 +1,6 @@ [[using-shell-components-ui-multiselect]] -==== Multi Select += Multi Select + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] The multi select component asks a user to select multiple items from a list. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-pathinput.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-pathinput.adoc index 938cb856..b50b3718 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-pathinput.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-pathinput.adoc @@ -1,5 +1,6 @@ [[using-shell-components-ui-pathinput]] -==== Path Input += Path Input + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] The path input component asks a user for a `Path` and gives additional information about a path itself. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-pathsearch.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-pathsearch.adoc index da98aa4a..03043bd4 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-pathsearch.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-pathsearch.adoc @@ -1,5 +1,6 @@ [[using-shell-components-ui-pathsearch]] -==== Path Search += Path Search + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] The path search component asks base directory for scan and optional search expression. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-render.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-render.adoc index 5b7e2390..3c2ac780 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-render.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-render.adoc @@ -1,5 +1,6 @@ [[using-shell-components-ui-render]] -==== Component Render += Component Render + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] You can implement component rendering in either of two ways: fully diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-singleselect.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-singleselect.adoc index e8ab5377..5189c1a7 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-singleselect.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-singleselect.adoc @@ -1,5 +1,6 @@ [[using-shell-components-ui-singleselect]] -==== Single Select += Single Select + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] A single select component asks a user to choose one item from a list. It is similar to a simple diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-stringinput.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-stringinput.adoc index 2fa84865..2a3b9196 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-stringinput.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-stringinput.adoc @@ -1,5 +1,6 @@ [[using-shell-components-ui-stringinput]] -==== String Input += String Input + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] The string input component asks a user for simple text input, optionally masking values diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui.adoc index a2a08a1f..9a32f40a 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui.adoc @@ -1,5 +1,6 @@ [[using-shell-components-ui]] -=== Flow Components += Flow Components + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Starting from version 2.1.x, a new component model provides an diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-components.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-components.adoc index 7a31c5df..615f57a2 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-components.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-components.adoc @@ -1,5 +1,5 @@ [[using-shell-components]] -== Components += Components Components are a set of features which are either build-in or something you can re-use or extend for your own needs. Components in question are diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-customization-commandnotfound.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-customization-commandnotfound.adoc index 5a76a99c..78a1f76e 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-customization-commandnotfound.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-customization-commandnotfound.adoc @@ -1,5 +1,6 @@ [[using-shell-customization-commandnotfound]] -=== Command Not Found += Command Not Found + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] On default a missing command is handled via `CommandNotFoundResultHandler` diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-customization-logging.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-customization-logging.adoc index 693d732b..4669ae68 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-customization-logging.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-customization-logging.adoc @@ -1,5 +1,5 @@ [[using-shell-customization-logging]] -=== Logging += Logging On default a _Spring Boot_ application will log messages into a console which at minimum is annoying and may also mix output from a shell commands. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-customization-singlecommand.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-customization-singlecommand.adoc index 19233207..f9b52111 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-customization-singlecommand.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-customization-singlecommand.adoc @@ -1,5 +1,6 @@ [[using-shell-customization-singlecommand]] -=== Single Command += Single Command + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] If your shell application is made for exactly a single purpose having only one diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-customization-styling.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-customization-styling.adoc index 109774ed..a38c17d6 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-customization-styling.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-customization-styling.adoc @@ -1,5 +1,6 @@ [[theming]] -=== Theming += Theming + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Current terminal implementations are rich in features and can usually show diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-customization.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-customization.adoc index e1c80c1c..15c654a5 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-customization.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-customization.adoc @@ -1,5 +1,5 @@ [[using-shell-customization]] -== Customization += Customization This section describes how you can customize the shell. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-execution.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-execution.adoc index d99e856c..2ea052ed 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-execution.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-execution.adoc @@ -1,11 +1,12 @@ [[using-shell-execution]] -== Execution += Execution + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] This section describes how to set up a Spring Shell to work in interactive mode. [[using-shell-execution-interactionmode]] -=== Interaction Mode +== Interaction Mode Version 2.1.x introduced built-in support to distinguish between interactive and non-interactive modes. This makes it easier to use the shell as a @@ -23,7 +24,7 @@ The `@ShellMethod` annotation has a field called `interactionMode` that you can shell about when a particular command is available. [[using-shell-execution-shellrunner]] -=== Shell Runners +== Shell Runners `ShellApplicationRunner` is a main interface where Boot's `ApplicationArguments` are passed and its default implementation makes a choice which `ShellRunner` is used. There can be diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-arity.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-arity.adoc index 53c2dc18..309a5b9e 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-arity.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-arity.adoc @@ -1,5 +1,6 @@ [[using-shell-options-arity]] -=== Arity += Arity + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Arity defines how many parameters option parsing takes. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics-annotation.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics-annotation.adoc index 227217f5..4956ae5b 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics-annotation.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics-annotation.adoc @@ -1,5 +1,6 @@ [[using-shell-options-basics-annotation]] -==== Annotation += Annotation + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] `Option` annotation can be used to define an option name if you diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics-legacyannotation.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics-legacyannotation.adoc index 3558bc84..2522891d 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics-legacyannotation.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics-legacyannotation.adoc @@ -1,5 +1,6 @@ [[using-shell-options-basics-legacyannotation]] -==== Legacy Annotation += Legacy Annotation + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Having a target method with argument is automatically registered with a matching diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics-programmatic.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics-programmatic.adoc index 2f7e93ba..9b860de5 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics-programmatic.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics-programmatic.adoc @@ -1,6 +1,7 @@ [[using-shell-options-basics-registration]] [[using-shell-options-basics-programmatic]] -==== Programmatic += Programmatic + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Programmatic way with `CommandRegistration` is to use `withOption` to define diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics.adoc index e5ce2638..300e17f2 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-basics.adoc @@ -1,5 +1,6 @@ [[using-shell-options-basics]] -=== Basics += Basics + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] This section gives a generic idea how an option can be defined. Following diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-default.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-default.adoc index 0bb54ef8..3477568d 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-default.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-default.adoc @@ -1,5 +1,6 @@ [[using-shell-options-default]] -=== Default Value += Default Value + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Having a default value for an option is somewhat related to diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-label.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-label.adoc index c2f8ccc5..6b98dfbd 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-label.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-label.adoc @@ -1,5 +1,6 @@ [[using-shell-options-label]] -=== Label += Label + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] _Option Label_ has no functional behaviour within a shell itself other than diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-naming.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-naming.adoc index ba9c9c50..b29ffb58 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-naming.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-naming.adoc @@ -1,5 +1,6 @@ [[using-shell-options-naming]] -=== Naming += Naming + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] If there is a need to modify option long names that can be done diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-optional.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-optional.adoc index e8bc088f..9ccaf875 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-optional.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-optional.adoc @@ -1,5 +1,6 @@ [[using-shell-options-optional]] -=== Optional Value += Optional Value + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] An option is either required or not and, generally speaking, how it behaves depends on diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-positional.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-positional.adoc index b54563cd..7c097c7c 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-positional.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-positional.adoc @@ -1,5 +1,6 @@ [[using-shell-options-positional]] -=== Positional += Positional + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Positional information is mostly related to a command target method: diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-short.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-short.adoc index 74fce393..846c7301 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-short.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-short.adoc @@ -1,5 +1,6 @@ [[using-shell-options-short]] -=== Short Format += Short Format + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Short style _POSIX_ option is usually just a synonym to long format. As diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-types.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-types.adoc index 4515d1e6..5a8557ca 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-types.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-types.adoc @@ -1,11 +1,12 @@ [[using-shell-options-types]] -=== Types += Types + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] This section talks about how particular data type is used as an option value. [[string]] -==== String +== String `String` is a most simplest type as there's no conversion involved as what's coming in from a user is always a string. @@ -28,7 +29,7 @@ include::{snippets}/OptionTypesSnippets.java[tag=option-type-string-reg] ==== [[boolean]] -==== Boolean +== Boolean Using boolean types is a bit more involved as there are `boolean` and `Boolean` where latter can be _null_. Boolean types are usually used as @@ -77,7 +78,7 @@ arg1=false arg2=true arg3=false arg4=false arg5=true arg6=false ==== [[number]] -==== Number +== Number Numbers are converted as is. @@ -96,7 +97,7 @@ include::{snippets}/OptionTypesSnippets.java[tag=option-type-integer-reg] ==== [[enum]] -==== Enum +== Enum Conversion to enums is possible if given value is exactly matching enum itself. Currently you can convert assuming case insensitivity. @@ -123,7 +124,7 @@ include::{snippets}/OptionTypesSnippets.java[tag=option-type-enum-reg] ==== [[array]] -==== Array +== Array Arrays can be used as is with strings and primitive types. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options-validation.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options-validation.adoc index 9676a814..7f44d37d 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options-validation.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options-validation.adoc @@ -1,5 +1,5 @@ [[validating-command-arguments]] -=== Validation += Validation Spring Shell integrates with the https://beanvalidation.org/[Bean Validation API] to support automatic and self-documenting constraints on command parameters. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-options.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-options.adoc index 09b9289b..250507ec 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-options.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-options.adoc @@ -1,5 +1,6 @@ [[using-shell-options]] -== Options += Options + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Command line arguments can be separated into options and positional parameters. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-testing-basics.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-testing-basics.adoc index d572aee1..0a8600a1 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-testing-basics.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-testing-basics.adoc @@ -1,5 +1,6 @@ [[using-shell-testing-basics]] -=== Basics += Basics + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Spring Shell provides a number of utilities and annotations to help when testing your application. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-testing-settings.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-testing-settings.adoc index 851a0c5e..990a8ddb 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-testing-settings.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-testing-settings.adoc @@ -1,5 +1,6 @@ [[using-shell-testing-settings]] -=== Settings += Settings + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Built in emulation uses terminal width 80 and height 24 on default. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-testing.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-testing.adoc index b2e5e3fb..9b8e6ae1 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-testing.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-testing.adoc @@ -1,5 +1,6 @@ [[using-shell-testing]] -== Testing += Testing + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Testing cli application is difficult due to various reasons: diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-tui-intro.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-tui-intro.adoc index 6c2d803c..47cff1e5 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-tui-intro.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-tui-intro.adoc @@ -1,5 +1,6 @@ [[using-shell-tui-intro]] -=== Introduction += Introduction + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Lets start with a simple app which prints "hello world" in a view. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-tui-views-box.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-tui-views-box.adoc index 719f99fe..7ca3ef9b 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-tui-views-box.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-tui-views-box.adoc @@ -1,5 +1,6 @@ [[using-shell-tui-views-box]] -==== BoxView += BoxView + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] _BoxView_ is a base implementation providing functionality to draw into a diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-tui-views-list.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-tui-views-list.adoc index 1a2504c0..a7922d41 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-tui-views-list.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-tui-views-list.adoc @@ -1,5 +1,6 @@ [[using-shell-tui-views-list]] -==== ListView += ListView + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] _ListView_ is a base implementation providing functionality to draw list of items. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-tui-views.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-tui-views.adoc index 1b806c3e..676d758c 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-tui-views.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-tui-views.adoc @@ -1,5 +1,6 @@ [[using-shell-tui-views]] -=== Views += Views + ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs] Framework provides a build-in views which are documented below. diff --git a/spring-shell-docs/modules/ROOT/pages/using-shell-tui.adoc b/spring-shell-docs/modules/ROOT/pages/using-shell-tui.adoc index 2fa4aacb..385ebc83 100644 --- a/spring-shell-docs/modules/ROOT/pages/using-shell-tui.adoc +++ b/spring-shell-docs/modules/ROOT/pages/using-shell-tui.adoc @@ -1,5 +1,5 @@ [[using-shell-tui]] -== Terminal UI += Terminal UI NOTE: Feature is experimental and subject to breaking changes until foundation and related concepts around framework are getting more stable.