Flatten docs structure

- Essentially remove "Using Spring Shell" and move
  its content one level up.
- Fixes #433
This commit is contained in:
Janne Valkealahti
2022-07-06 09:36:36 +01:00
parent 32f77c1917
commit 03a02a0615
32 changed files with 50 additions and 53 deletions

View File

@@ -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.
====

View File

@@ -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.

View File

@@ -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

View File

@@ -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:

View File

@@ -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

View File

@@ -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

View File

@@ -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`,

View File

@@ -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:

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -1,5 +1,5 @@
[[using-shell-customization]]
=== Customization
== Customization
This section describes how you can customize the shell.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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[]