Skip to content

Commit

Permalink
Allow SubCommand annotation with Command
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Dec 7, 2016
1 parent 0fd8d67 commit bb51d36
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions toolbelt/src/main/java/com/simplifyops/toolbelt/ToolBelt.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}

}
Expand Down

0 comments on commit bb51d36

Please sign in to comment.