From 25a39bbe7e03e2c9d42e665e526f99d7139a2412 Mon Sep 17 00:00:00 2001 From: Patrice Duroux Date: Sun, 2 May 2021 20:08:41 +0200 Subject: [PATCH] revert the rename and keep the plural --- .../graalvm/example/FullExample-reflect-config.json | 2 +- .../graalvm/example/example-interface-reflect.json | 2 +- .../src/test/resources/example-interface-reflect.json | 2 +- picocli-codegen/src/test/resources/example-reflect.json | 2 +- src/main/java/picocli/CommandLine.java | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/FullExample-reflect-config.json b/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/FullExample-reflect-config.json index b38b1c564..62c7025a5 100644 --- a/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/FullExample-reflect-config.json +++ b/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/FullExample-reflect-config.json @@ -17,7 +17,7 @@ "allDeclaredMethods" : true, "allPublicMethods" : true, "fields" : [ - { "name" : "command" }, + { "name" : "commands" }, { "name" : "helpRequested" } ] }, diff --git a/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/example-interface-reflect.json b/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/example-interface-reflect.json index bd630e4a9..baec1a781 100644 --- a/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/example-interface-reflect.json +++ b/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/example-interface-reflect.json @@ -31,7 +31,7 @@ "allDeclaredMethods" : true, "allPublicMethods" : true, "fields" : [ - { "name" : "command" }, + { "name" : "commands" }, { "name" : "helpRequested" } ] }, diff --git a/picocli-codegen/src/test/resources/example-interface-reflect.json b/picocli-codegen/src/test/resources/example-interface-reflect.json index c65533079..0b1120208 100644 --- a/picocli-codegen/src/test/resources/example-interface-reflect.json +++ b/picocli-codegen/src/test/resources/example-interface-reflect.json @@ -31,7 +31,7 @@ "allDeclaredMethods" : true, "allPublicMethods" : true, "fields" : [ - { "name" : "command" }, + { "name" : "commands" }, { "name" : "helpRequested" } ] }, diff --git a/picocli-codegen/src/test/resources/example-reflect.json b/picocli-codegen/src/test/resources/example-reflect.json index 6144be313..d2eb204a7 100644 --- a/picocli-codegen/src/test/resources/example-reflect.json +++ b/picocli-codegen/src/test/resources/example-reflect.json @@ -31,7 +31,7 @@ "allDeclaredMethods" : true, "allPublicMethods" : true, "fields" : [ - { "name" : "command" }, + { "name" : "commands" }, { "name" : "helpRequested" } ] }, diff --git a/src/main/java/picocli/CommandLine.java b/src/main/java/picocli/CommandLine.java index 5ed2ce907..b8dbd7ddf 100644 --- a/src/main/java/picocli/CommandLine.java +++ b/src/main/java/picocli/CommandLine.java @@ -14753,7 +14753,7 @@ public static final class HelpCommand implements IHelpCommandInitializable, IHel @Parameters(paramLabel = "COMMAND", arity="0..1", descriptionKey = "helpCommand.command", description = "The COMMAND to display the usage help message for.") - private String command; + private String commands; private CommandLine self; private PrintStream out; @@ -14768,9 +14768,9 @@ public void run() { CommandLine parent = self == null ? null : self.getParent(); if (parent == null) { return; } Help.ColorScheme colors = colorScheme != null ? colorScheme : Help.defaultColorScheme(ansi); - if (command != null) { + if (commands != null) { Map parentSubcommands = parent.getCommandSpec().subcommands(); - String fullName = command; + String fullName = commands; if (parent.isAbbreviatedSubcommandsAllowed()) { fullName = AbbreviationMatcher.match(parentSubcommands.keySet(), fullName, parent.isSubcommandsCaseInsensitive(), self); @@ -14783,7 +14783,7 @@ public void run() { subcommand.usage(out, colors); // for compatibility with pre-4.0 clients } } else { - throw new ParameterException(parent, "Unknown subcommand '" + command + "'.", null, command); + throw new ParameterException(parent, "Unknown subcommand '" + commands + "'.", null, commands); } } else { if (outWriter != null) {