Skip to content

Commit

Permalink
[#1352] Fix subcommand resource bundle test regression
Browse files Browse the repository at this point in the history
  • Loading branch information
NewbieOrange authored and remkop committed Oct 31, 2021
1 parent eb22ff1 commit b08753d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/picocli/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -6412,7 +6412,7 @@ public CommandSpec addSubcommand(String name, CommandSpec subcommand) {
*/
public CommandSpec addSubcommand(String name, CommandLine subCommandLine) {
CommandSpec subSpec = subCommandLine.getCommandSpec();
String actualName = validateSubcommandName(name, subSpec);
String actualName = interpolator.interpolateCommandName(validateSubcommandName(name, subSpec));
Tracer t = new Tracer();
if (t.isDebug()) {t.debug("Adding subcommand '%s' to '%s'%n", actualName, this.qualifiedName());}
String previousName = commands.getCaseSensitiveKey(actualName);
Expand All @@ -6422,7 +6422,7 @@ public CommandSpec addSubcommand(String name, CommandLine subCommandLine) {
subSpec.parent(this);
for (String alias : subSpec.aliases()) {
if (t.isDebug()) {t.debug("Adding alias '%s' for '%s'%n", (parent == null ? "" : parent.qualifiedName() + " ") + alias, this.qualifiedName());}
previous = commands.put(alias, subCommandLine);
previous = commands.put(interpolator.interpolate(alias), subCommandLine);
if (previous != null && previous != subCommandLine) { throw new DuplicateNameException("Alias '" + alias + "' for subcommand '" + actualName + "' is already used by another subcommand of '" + this.name() + "'"); }
}
subSpec.initCommandHierarchyWithResourceBundle(resourceBundleBaseName(), resourceBundle());
Expand Down

0 comments on commit b08753d

Please sign in to comment.