diff --git a/toolbelt/src/main/java/com/simplifyops/toolbelt/ToolBelt.java b/toolbelt/src/main/java/com/simplifyops/toolbelt/ToolBelt.java index 4d8cbbc..ebe047e 100644 --- a/toolbelt/src/main/java/com/simplifyops/toolbelt/ToolBelt.java +++ b/toolbelt/src/main/java/com/simplifyops/toolbelt/ToolBelt.java @@ -584,12 +584,12 @@ private void introspect(CommandSet parent, final Object instance) { } String cmdDescription = null != annotation1 ? annotation1.description() : null; boolean isSub = false; - if (null == annotation1) { - SubCommand annotation2 = aClass.getAnnotation(SubCommand.class); - if (null != annotation2) { - isSub = true; - } + + SubCommand subcmdAnnotation = aClass.getAnnotation(SubCommand.class); + if (null != subcmdAnnotation) { + isSub = true; } + boolean isHidden = false; Hidden annotation2 = aClass.getAnnotation(Hidden.class); if (null != annotation2) { @@ -649,6 +649,7 @@ private void introspect(CommandSet parent, final Object instance) { parent.getSynonyms().addAll(synonyms); } else { parent.commands.putAll(commandSet.commands); + parent.commandSynonyms.putAll(subSynonyms); } }