From 16955274089b1508dc4e41e2c0301717f261a726 Mon Sep 17 00:00:00 2001 From: altus34 Date: Fri, 22 Sep 2017 12:00:03 -0400 Subject: [PATCH] Fix documentation - Optional Parameters and Default Values. Type error in greet method signature who cause compile error - Customizing the Named Parameter Key(s). help method is already registered in spring shell by default and cannot be reused --- .../src/main/asciidoc/using-spring-shell.adoc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/spring-shell-docs/src/main/asciidoc/using-spring-shell.adoc b/spring-shell-docs/src/main/asciidoc/using-spring-shell.adoc index ce54c128..74df71d2 100644 --- a/spring-shell-docs/src/main/asciidoc/using-spring-shell.adoc +++ b/spring-shell-docs/src/main/asciidoc/using-spring-shell.adoc @@ -235,11 +235,12 @@ For such a setup, the possible parameter keys will be `-a`, `-b` and `--third`. [TIP] ==== It is possible to specify several keys for a single parameter. If so, these will be mutually exclusive ways -to specify the same parameter (so only one of them can be used). Here is an example: +to specify the same parameter (so only one of them can be used). As an example, here is the signature of the +built-in xref:help-command[`help`] command: [source, java] ---- @ShellMethod("Describe a command.") - public String help(@ShellOption({"-C", "--command"} String command) { + public String help(@ShellOption({"-C", "--command"}) String command) { ... } ---- @@ -252,7 +253,7 @@ those parameters: [source, java] ---- @ShellMethod("Say hello.") - public String greet(@ShellOption(defaultValue="World"} String who) { + public String greet(@ShellOption(defaultValue="World") String who) { return "Hello " + who; } ---- @@ -588,8 +589,6 @@ wildcard that matches all command names. It's thus easy to turn all commands of with a single availability method. ==== - - [TIP] ==== Spring Shell does not impose much constraints on how to write commands and how to organize classes.