Skip to content

Commit

Permalink
fix: nesting of cli plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
iocanel committed May 8, 2023
1 parent d7d3198 commit 8e478ea
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 8e478ea

Please sign in to comment.