Skip to content

Commit

Permalink
fix: nesting of cli plugins
Browse files Browse the repository at this point in the history
(cherry picked from commit 8e478ea)
  • Loading branch information
iocanel authored and gsmet committed May 10, 2023
1 parent 6a33359 commit 7101d00
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ public void populateCommands(CommandLine cmd, Map<String, Plugin> plugins) {
plugins.entrySet().stream()
.map(Map.Entry::getValue).forEach(plugin -> {
CommandLine current = cmd;
String name = plugin.getName();
// The plugin is stripped from its prefix when added to the catalog.
// Let's added back to ensure it matches the CLI root command.
String name = cmd.getCommandName() + "-" + plugin.getName();
while (current != null && current.getCommandName() != null
&& name.startsWith(current.getCommandName() + "-")) {
String remaining = name.substring(current.getCommandName().length() + 1);
Expand Down

0 comments on commit 7101d00

Please sign in to comment.