Do not double add BaseCommands in RootCommand children #439

Also register command aliases more completely
This commit is contained in:
chickeneer
2025-11-21 03:44:18 -06:00
parent 3b2de1f46e
commit f5df0e8117
2 changed files with 4 additions and 1 deletions
@@ -263,6 +263,7 @@ public abstract class BaseCommand {
Collections.addAll(cmdList, cmdAliases);
cmdList.remove(cmd);
for (String cmdAlias : cmdList) {
registerSubclasses(cmdAlias);
register(cmdAlias, this);
}
}
@@ -48,7 +48,9 @@ public interface RootCommand {
subCommands.put(e.getKey(), e.getValue());
});
children.add(command);
if (!children.contains(command)) {
children.add(command);
}
}
/**