Flatten docs structure
- Essentially remove "Using Spring Shell" and move its content one level up. - Fixes #433
This commit is contained in:
@@ -9,6 +9,15 @@ The Spring Shell project provides the infrastructure to create such a REPL (Read
|
||||
Print Loop) application, letting you concentrate on implementing commands by using
|
||||
the familiar Spring programming model.
|
||||
|
||||
Spring Shell includes advanced features (such as parsing, tab completion, colorization of
|
||||
Spring Shell includes advanced features (such as parsing, tab completion, colorization of
|
||||
output, fancy ASCII-art table display, input conversion, and validation), freeing you
|
||||
to focus on core command logic.
|
||||
|
||||
[IMPORTANT]
|
||||
====
|
||||
Spring Shell 2.1.x is a major rework to bring the codebase up to date with
|
||||
existing Spring Boot versions, adding new features and, especially,
|
||||
making it work with GraalVM which makes command-line applications much
|
||||
more relevant in a Java space. Moving to a new major version also lets
|
||||
us clean up the codebase and make some needed breaking changes.
|
||||
====
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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.
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[[using-shell-building]]
|
||||
=== Building
|
||||
== Building
|
||||
|
||||
This section covers how to build a Spring Shell application.
|
||||
|
||||
[[native]]
|
||||
==== Native Support
|
||||
=== Native Support
|
||||
|
||||
Version 2.1.x includes experimental support for compiling Spring Shell applications
|
||||
into native applications with GraalVM and Spring Native. Because the underlying JLine
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==== Annotation Model
|
||||
=== Annotation Model
|
||||
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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[dynamic-command-exitcode]]
|
||||
==== Exit Code
|
||||
=== Exit Code
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
|
||||
Many command line applications when applicable return an _exit code_ which running environment
|
||||
|
||||
@@ -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`,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==== Programmatic Model
|
||||
=== Programmatic Model
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
|
||||
In the programmatic model, `CommandRegistration` is defined as a `@Bean`, and it is automatically registered:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
=== 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
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[[built-in-commands]]
|
||||
==== Built-In Commands
|
||||
=== Built-In Commands
|
||||
|
||||
[[help-command]]
|
||||
===== 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,
|
||||
@@ -79,17 +79,17 @@ script: Read and execute commands from a file.
|
||||
----
|
||||
====
|
||||
|
||||
===== Clear
|
||||
==== Clear
|
||||
The `clear` command does what you would expect and clears the screen, resetting the prompt
|
||||
in the top left corner.
|
||||
|
||||
===== 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
|
||||
commands to disk, so that they are available again on the next launch.
|
||||
|
||||
===== 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.
|
||||
@@ -99,14 +99,14 @@ To this end, Spring Shell remembers the last exception that occurred, and the us
|
||||
command to print all the details on the console.
|
||||
|
||||
[[script-command]]
|
||||
===== Script
|
||||
==== Script
|
||||
|
||||
The `script` command accepts a local file as an argument and replays commands found there, one at a time.
|
||||
|
||||
Reading from the file behaves exactly like inside the interactive shell, so lines starting with `//` are considered
|
||||
to be comments and are ignored, while lines ending with `\` trigger line continuation.
|
||||
|
||||
===== History
|
||||
==== History
|
||||
|
||||
The `history` command shows the history of commands that has been executed.
|
||||
|
||||
@@ -122,7 +122,7 @@ a placeholder (`{userconfig}`), which resolves to a common shared config directo
|
||||
|
||||
TIP: Run the Spring Shell application to see how the sample application works as it uses these options.
|
||||
|
||||
===== 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
|
||||
@@ -130,7 +130,7 @@ working with non-interactive mode.
|
||||
|
||||
Currently, the only implementation is for bash, which works with `bash` sub-command.
|
||||
|
||||
===== 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[using-shell-components-flow]]
|
||||
==== Flow
|
||||
=== Flow
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
|
||||
When you use <<using-shell-components-ui>> to build something that involves
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[theming]]
|
||||
==== Theming
|
||||
=== Theming
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
|
||||
Current terminal implementations are rich in features and can usually show
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[using-shell-customization]]
|
||||
=== Customization
|
||||
== Customization
|
||||
|
||||
This section describes how you can customize the shell.
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== Execution
|
||||
== Execution
|
||||
|
||||
This section describes how to set up a Spring Shell to work in interactive mode.
|
||||
|
||||
==== 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[using-shell-options-arity]]
|
||||
==== Arity
|
||||
=== Arity
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
|
||||
Sometimes, you want to have more fine control of how many parameters with an option
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[using-shell-options-definition]]
|
||||
==== Definition
|
||||
=== Definition
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
|
||||
Options can be defined within a target method as annotations in a method arguments
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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 behavesit depends on
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[using-shell-options-short]]
|
||||
==== Short Format
|
||||
=== Short Format
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
|
||||
Short style _POSIX_ option in most is just a synonym to long format but
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[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.
|
||||
|
||||
@@ -1,15 +1,3 @@
|
||||
== Using Spring Shell
|
||||
This section describes how to use Spring Shell.
|
||||
|
||||
[IMPORTANT]
|
||||
====
|
||||
Spring Shell 2.1.x is a major rework to bring the codebase up to date with
|
||||
existing Spring Boot versions, adding new features and, especially,
|
||||
making it work with GraalVM which makes command-line applications much
|
||||
more relevant in a Java space. Moving to a new major version also lets
|
||||
us clean up the codebase and make some needed breaking changes.
|
||||
====
|
||||
|
||||
include::using-shell-basics.adoc[]
|
||||
|
||||
include::using-shell-commands.adoc[]
|
||||
|
||||
Reference in New Issue
Block a user