Skip to content

Commit e3cb937

Browse files
committed
Update documentation
1 parent d909f79 commit e3cb937

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+182
-189
lines changed

spring-shell-docs/modules/ROOT/pages/appendices/techintro/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[appendix]
22
[#appendix-tech-intro]
3-
= Techical Introduction
3+
= Technical Introduction
44
:page-section-summary-toc: 1
55

66
This appendix contains information for developers and others who would like to know more about how Spring Shell

spring-shell-docs/modules/ROOT/pages/appendices/tui/catalog.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]
66

7-
Catalog application is showing various ways how Terminal UI Framework can be used.
8-
In this section we discuss how this application works. It can be considered to be
7+
Catalog application shows various ways how the Terminal UI Framework can be used.
8+
In this section, we discuss how this application works. It can be considered as
99
a reference application as it's using most of the features available and tries
10-
to follow best practices.
10+
to follow the best practices.
1111

1212
[[create-scenario]]
1313
== Create Scenario

spring-shell-docs/modules/ROOT/pages/appendices/tui/index.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
77

8-
This is a technical introduction to _UI Framework_.
8+
This is a technical introduction to the _UI Framework_.
99

10-
_UI Framework_ is a toolkit to build rich console apps.
10+
The _UI Framework_ is a toolkit to build rich console apps.
1111

1212

1313

spring-shell-docs/modules/ROOT/pages/appendices/tui/viewdev.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
= View Development
33
:page-section-summary-toc: 1
44

5-
While a _view_ just need to implement `View` it's usually convenient to just
5+
While a _view_ just needs to implement `View`, it's usually convenient to just
66
use `BoxView` as a parent.
77

88
[[register-bindings]]

spring-shell-docs/modules/ROOT/pages/basics/reading.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
Throughout this documentation, we make references to configuring something by using
66
annotations or programmatic examples.
77

8-
NOTE: There are two annotation models, xref:commands/registration/annotation.adoc[annotations]
9-
referred to new annotation model, xref:commands/registration/legacyannotation.adoc[legacy annotations]
10-
referred to old legacy annotation model.
8+
NOTE: There are two annotation models: the xref:commands/registration/annotation.adoc[annotations] model
9+
referred to as the new annotation model, and the xref:commands/registration/legacyannotation.adoc[legacy annotations]
10+
model referred to as the old legacy annotation model.
1111

12-
Old legacy annotation model mostly relates to use of `@ShellMethod` and `@ShellOption` and
13-
new annotation model relates to use of `@Command`.
12+
The old legacy annotation model mostly relates to the use of `@ShellMethod` and `@ShellOption` and
13+
the new annotation model relates to the use of `@Command`.
1414

1515
The programmatic model is how things are actually registered, even if you use annotations.
1616

17-
NOTE: The documentation structure is getting revised to clarify how to provide configurations in separate ways. Thank you for understanding while that work is still in progress.
17+
NOTE: The documentation structure is getting revised to clarify how to provide configurations in separate ways.

spring-shell-docs/modules/ROOT/pages/building.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ traditionally been relatively complex process while it may look like
2525
there's not that much happening as it's all just text.
2626

2727
Remember all those old manual typewriters or matrix printers?
28-
A character is printed where a cursor is which then need to be moved
28+
A character is printed then a cursor needs to be moved
2929
if printing in a different position. In a nutshell that's how current
3030
terminal emulators work.
3131

32-
To access and understand existing terminal emulator environment better
32+
To access and understand existing terminal emulators environment better,
3333
JLine can use native code via its own shared libraries. JLine detects
3434
which providers are present and then makes a choice which one to use.
3535
Traditionally there's been 3 providers, `jansi`, `jni` and `jna` which
3636
should all provide same functionalities.
3737

38-
Our starters can be used to spesifically pick some of these JLine
38+
Our starters can be used to specifically pick some of these JLine
3939
providers.
4040

4141
== FFM
@@ -127,7 +127,7 @@ When gradle build is run with `./gradlew nativeCompile` you should get binary
127127
under `build/native/nativeCompile` directory.
128128

129129
For `maven` use `spring-boot-starter-parent` as parent and you'll get `native`
130-
profile which can be used to do a compilation. You need to configure metadata repository
130+
profile which can be used to do a native compilation. You need to configure metadata repository:
131131

132132
[source, xml, subs=attributes+]
133133
----

spring-shell-docs/modules/ROOT/pages/commands/alias.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ cases where you want to create a shorter version of a command or going
88
through a complete command rename while keeping old one temporarily in
99
place.
1010

11-
Format for _alias_ is slighly different than a _command_. When _command_
11+
The format of _alias_ is slightly different from a _command_. When _command_
1212
is defined as an array it's concatenated together into a single command.
13-
When _alias_ is defined as an array it's used to create a separate
14-
aliases.
13+
When _alias_ is defined as an array it's used to create separate aliases.
1514

1615
Aliases with a plain `CommandRegistration` is simple and clear as you
1716
get exactly what you define as there's no "magic" in it.

spring-shell-docs/modules/ROOT/pages/commands/builtin/clear.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
= Clear
33
:page-section-summary-toc: 1
44

5-
The `clear` command does what you would expect and clears the screen, resetting the prompt
5+
The `clear` command clears the screen, resetting the prompt
66
in the top left corner.

spring-shell-docs/modules/ROOT/pages/commands/builtin/completion.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
= Completion
33
:page-section-summary-toc: 1
44

5-
The `completion` command set lets you create script files that can be used
6-
with am OS shell implementations to provide completion. This is very useful when
5+
The `completion` command lets you create script files that can be used
6+
with an OS shell implementation to provide completion. This is very useful when
77
working with non-interactive mode.
88

9-
Currently, the only implementation is for bash, which works with `bash` sub-command.
9+
Currently, the only implementation is for bash, which works with the `bash` sub-command.

spring-shell-docs/modules/ROOT/pages/commands/builtin/help.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
= Help
33

44
Running a shell application often implies that the user is in a graphically limited
5-
environment. Also, while we are nearly always connected in the era of mobile phones,
6-
accessing a web browser or any other rich UI application (such as a PDF viewer) may not always
7-
be possible. This is why it is important that the shell commands are correctly self-documented, and this is where the `help`
5+
environment. This is why it is important that the shell commands are correctly self-documented, and this is where the `help`
86
command comes in.
97

108
Typing `help` + `ENTER` lists all the commands known to the shell (including xref:commands/availability.adoc[unavailable] commands)

spring-shell-docs/modules/ROOT/pages/commands/exceptionhandling/annotation.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
66
`@ShellComponent` classes can have `@ExceptionResolver` methods to handle exceptions from component
77
methods. These are meant for annotated methods.
88

9-
The exception may match against a top-level exception being propagated (e.g. a direct IOException
10-
being thrown) or against a nested cause within a wrapper exception (e.g. an IOException wrapped
11-
inside an IllegalStateException). This can match at arbitrary cause levels.
9+
The exception may match against a top-level exception being propagated (e.g. a direct `IOException`
10+
being thrown) or against a nested cause within a wrapper exception (e.g. an `IOException` wrapped
11+
inside an `IllegalStateException`). This can match at arbitrary cause levels.
1212

1313
For matching exception types, preferably declare the target exception as a method argument, as
1414
the preceding example(s) shows. When multiple exception methods match, a root exception match is
15-
generally preferred to a cause exception match. More specifically, the ExceptionDepthComparator
15+
generally preferred to a cause exception match. More specifically, the `ExceptionDepthComparator`
1616
is used to sort exceptions based on their depth from the thrown exception type.
1717

1818
Alternatively, the annotation declaration may narrow the exception types to match, as the
@@ -38,7 +38,7 @@ include::{snippets}/ErrorHandlingSnippets.java[tag=exception-resolver-with-exitc
3838

3939
`@ExceptionResolver` with `void` return type is automatically handled as handled exception.
4040
You can then also define `@ExitCode` and use `Terminal` if you need to write something
41-
into console.
41+
into the console:
4242

4343
[source, java, indent=0]
4444
----

spring-shell-docs/modules/ROOT/pages/commands/exceptionhandling/index.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
66

7-
Exceptions happen from a user code wether it is intentional or not. This section describes
8-
how `spring-shell` handles exceptions and gives instructions and best practices how to
7+
Exceptions happen from a user code whether it is intentional or not. This section describes
8+
how Spring Shell handles exceptions and gives instructions and best practices on how to
99
work with it.
1010

11-
Many command line applications when applicable return an _exit code_ which running environment
12-
can use to differentiate if command has been executed successfully or not. In a `spring-shell`
13-
this mostly relates when a command is run on a non-interactive mode meaning one command
14-
is always executed once with an instance of a `spring-shell`. Take a note that _exit code_
15-
always relates to non-interactive shell.
11+
Many command line applications return an _exit code_ which can be used by the
12+
running environment to differentiate if command has been executed successfully or not.
13+
In Spring Shell, this mostly relates to when a command is run in a non-interactive mode,
14+
meaning one command is always executed once with an instance of a `spring-shell`. Take a note
15+
that _exit code_ always relates to non-interactive shell.
1616

1717

1818

spring-shell-docs/modules/ROOT/pages/commands/exceptionhandling/mappings.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
55

66
Default behaviour of an exit codes is as:
77

8-
- Errors from a command option parsing will result code of `2`
9-
- Any generic error will result result code of `1`
10-
- Obviously in any other case result code is `0`
8+
- Errors from a command option parsing will result to a code of `2`
9+
- Any generic error will result to a code of `1`
10+
- Obviously in any other case will result to a code of `0`
1111

1212
Every `CommandRegistration` can define its own mappings between _Exception_ and _exit code_.
13-
Essentially we're bound to functionality in `Spring Boot` regarding _exit code_ and simply
13+
Spring shell uses a similar approach to `Spring Boot` regarding _exit code_ and simply
1414
integrate into that.
1515

16-
Assuming there is an exception show below which would be thrown from a command:
16+
Assuming there is an exception shown below which would be thrown from a command:
1717

1818
[source, java, indent=0]
1919
----

spring-shell-docs/modules/ROOT/pages/commands/exceptionhandling/resolving.adoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
55

66
Unhandled exceptions will bubble up into shell's `ResultHandlerService` and then eventually
77
handled by some instance of `ResultHandler`. Chain of `ExceptionResolver` implementations
8-
can be used to resolve exceptions and gives you flexibility to return message to get written
9-
into console together with exit code which are wrapped within `CommandHandlingResult`.
8+
can be used to resolve exceptions and gives you the flexibility to return a message to get
9+
written into the console together with exit code which are wrapped within `CommandHandlingResult`.
1010
`CommandHandlingResult` may contain a _message_ and/or _exit code_.
1111

1212
[source, java, indent=0]
1313
----
1414
include::{snippets}/ErrorHandlingSnippets.java[tag=my-exception-resolver-class]
1515
----
1616

17-
`CommandExceptionResolver` implementations can be defined globally as bean.
17+
`CommandExceptionResolver` implementations can be defined globally as beans:
1818

1919
[source, java, indent=0]
2020
----
2121
include::{snippets}/ErrorHandlingSnippets.java[tag=my-exception-resolver-class-as-bean]
2222
----
2323

24-
or defined per `CommandRegistration` if it's applicable only for a particular command itself.
24+
or defined per `CommandRegistration` if it's applicable only to a particular command:
2525

2626
[source, java, indent=0]
2727
----
@@ -31,18 +31,18 @@ include::{snippets}/ErrorHandlingSnippets.java[tag=example1]
3131
NOTE: Resolvers defined with a command are handled before global resolvers.
3232

3333

34-
Use you own exception types which can also be an instance of boot's `ExitCodeGenerator` if
35-
you want to define exit code there.
34+
You can use your own exception types which can also be instances of Spring Boot's `ExitCodeGenerator`
35+
if you want to define exit code there:
3636

3737
[source, java, indent=0]
3838
----
3939
include::{snippets}/ErrorHandlingSnippets.java[tag=my-exception-class]
4040
----
4141

42-
Some build in `CommandExceptionResolver` beans are registered to handle common
42+
Some built-in `CommandExceptionResolver` beans are registered to handle common
4343
exceptions thrown from command parsing. These are registered with _order_
44-
presedence defined in `CommandExceptionResolver.DEFAULT_PRECEDENCE`.
44+
precedence defined in `CommandExceptionResolver.DEFAULT_PRECEDENCE`.
4545
As these beans are used in a given order, `@Order` annotation or `Ordered`
46-
interface from can be used just like in any other spring app. This
46+
interface can be used just like in any other Spring app. This
4747
is generally useful if you need to control your own beans to get used
48-
either before or after a defaults.
48+
either before or after default ones.

spring-shell-docs/modules/ROOT/pages/commands/helpoptions.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
55

66
_Spring Shell_ has a build-in `help` command but not all favour getting command help
77
from it as you always need to call it with arguments for target command. It's
8-
common in many cli frameworks for every command having options _--help_ and _-h_
8+
common in many CLI frameworks for every command having options _--help_ and _-h_
99
to print out command help.
1010

1111
Default functionality is that every command will get modified to have options
1212
_--help_ and _-h_, which if present in a given command will automatically
13-
short circuit command execution into a existing `help` command regardless
14-
what other command-line options is typed.
13+
short circuit command execution into an existing `help` command regardless
14+
what other command-line options are typed.
1515

16-
Below example shows its default settings.
16+
The following example shows its default settings:
1717

1818
[source, java, indent=0]
1919
----
2020
include::{snippets}/CommandRegistrationHelpOptionsSnippets.java[tag=defaults]
2121
----
2222

23-
It is possible to change default behaviour via configuration options.
23+
It is possible to change default behaviour via configuration options:
2424

2525
[source, yaml]
2626
----
@@ -33,6 +33,6 @@ spring:
3333
command: help
3434
----
3535

36-
NOTE: Commands defined programmationally or via annotations will automatically add
37-
help options. With annotation model you can only turn things off globally, programmatic
38-
model gives option to modify settings per command.
36+
NOTE: Commands defined programmatically or via annotations will automatically add
37+
help options. With the annotation model you can only turn things off globally, while
38+
with the programmatic model you can modify settings per command.

spring-shell-docs/modules/ROOT/pages/commands/hidden.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
55

66
It is possible to _hide_ a command which is convenient in cases where it is not yet ready for
7-
prime time, is meant for debugging purposes or you have any other reason you dont want to
8-
advertise its presense.
7+
prime time, or is meant for debugging purposes or you have any other reason you don't want to
8+
advertise its presence.
99

10-
Hidden command can be executed if you know it and its options. It is effectively removed
10+
A hidden command can be executed if you know it and its options. It is effectively removed
1111
from:
1212

1313
* Help listing
1414
* Help page for command return "unknown command"
1515
* Command completion in interactive mode
1616
* Bash completion
1717

18-
Below is an example how to define command as _hidden_. It shows available builder methods
18+
Below is an example of how to define _hidden_ command. It shows available builder methods
1919
to define _hidden_ state.
2020

2121
[source, java, indent=0]

spring-shell-docs/modules/ROOT/pages/commands/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
66

77
In this section, we go through an actual command registration and leave command options
8-
and execution for later in a documentation. You can find more detailed info in
8+
and execution for a later section in the documentation. You can find more details in
99
xref:appendices/techintro/registration.adoc[Command Registration].
1010

1111

spring-shell-docs/modules/ROOT/pages/commands/interactionmode.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]
66

77
Command registration can define `InteractionMode` which is used to hide commands
8-
depending which mode shell is executing. More about that in xref:execution.adoc#using-shell-execution-interactionmode[Interaction Mode].
8+
depending on which mode the shell is executing in. More about that in xref:execution.adoc#using-shell-execution-interactionmode[Interaction Mode].
99

10-
You can define it with `CommandRegisration`.
10+
You can define the interaction mode with `CommandRegisration`:
1111

1212
[source, java, indent=0]
1313
----

spring-shell-docs/modules/ROOT/pages/commands/registration/index.adoc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44

55
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
66

7-
There are two different ways to define a command: through an annotation model and
8-
through a programmatic model. In the annotation model, you define your methods
9-
in a class and annotate the class and the methods with specific annotations.
10-
In the programmatic model, you use a more low level approach, defining command
11-
registrations (either as beans or by dynamically registering with a command catalog).
7+
There are two different ways to define a command. through an annotation model and through a programmatic model:
128

13-
Starting from _3.1.x_ a better support for defining commands using
14-
xref:commands/registration/annotation.adoc[annotations] were added. Firstly because eventually standard
9+
- In the annotation model, you define your methods in a class and annotate the class and the methods with specific annotations.
10+
- In the programmatic model, you use a more low level approach, defining command registrations (either as beans or by dynamically registering with a command catalog).
11+
12+
Starting from version _3.1.x_, a better support for defining commands using
13+
xref:commands/registration/annotation.adoc[annotations] was added. Firstly because eventually standard
1514
package providing xref:commands/registration/legacyannotation.adoc[legacy annotations] will get deprecated
1615
and removed. Secondly so that we're able to provide same set of features than using underlying
1716
`CommandRegistration`. Creating a new annotation model allows us to rethink and modernise that

spring-shell-docs/modules/ROOT/pages/commands/registration/programmatic.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ a new builder so you don't need to worry about its internal state.
1919
IMPORTANT: Commands registered programmatically automatically
2020
add _help options_ mentioned in xref:commands/helpoptions.adoc[Help Options].
2121

22-
If bean of this supplier type is defined then auto-configuration
22+
If a bean of this supplier type is defined then auto-configuration
2323
will back off giving you an option to redefine default functionality.
2424

2525
[source, java, indent=0]
@@ -28,7 +28,7 @@ include::{snippets}/CommandRegistrationBeanSnippets.java[tag=fromsupplier]
2828
----
2929

3030
`CommandRegistrationCustomizer` beans can be defined if you want to centrally
31-
modify builder instance given you by supplier mentioned above.
31+
modify builder instance given to you by a supplier as mentioned below:
3232

3333
[source, java, indent=0]
3434
----

spring-shell-docs/modules/ROOT/pages/completion.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ methods which takes `CompletionContext` and returns a list of
1818
`CompletionProposal` instances. `CompletionContext` gives you various
1919
information about a current context like command registration and option.
2020

21-
NOTE: Generic resolvers can be registered as a beans if those are useful
22-
for all commands and scenarious. For example existing completion
21+
NOTE: Generic resolvers can be registered as beans if those are useful
22+
for all commands and scenarios. For example existing completion
2323
implementation `RegistrationOptionsCompletionResolver` handles completions
2424
for a option names.
2525

0 commit comments

Comments
 (0)