Fix alias usage in help command

- Add info about aliases into model structure used by help
  command templating.
- Add some tests to models.
- Change help commands list to group command and its aliases together.
- Change help command to show aliases.
- Fixes #458
- Fixes #426
This commit is contained in:
Janne Valkealahti
2022-07-14 16:31:14 +01:00
parent d88849dfa9
commit 06d9fd51b2
10 changed files with 265 additions and 13 deletions

View File

@@ -23,7 +23,9 @@ import org.springframework.shell.standard.ShellMethod;
@ShellComponent
public class AliasCommands {
@ShellMethod(key = { "alias anno main1", "alias anno main2" }, group = "Alias Commands")
private final static String DESCRIPTION = "main1 with main2 as alias";
@ShellMethod(key = { "alias anno main1", "alias anno main2" }, group = "Alias Commands", value = DESCRIPTION)
public String annoMain1() {
return "Hello annoMain1";
}
@@ -33,6 +35,7 @@ public class AliasCommands {
return CommandRegistration.builder()
.command("alias", "reg", "main1")
.group("Alias Commands")
.description(DESCRIPTION)
.withAlias()
.command("alias", "reg", "main2")
.group("Alias Commands")