🐛 Fix issues with intermediary command help

This commit is contained in:
Alexander Söderberg 2020-10-04 18:54:56 +02:00
parent 22993a46d7
commit f7bc31df27
No known key found for this signature in database
GPG key ID: C0207FF7EA146678

View file

@ -203,9 +203,14 @@ public final class CommandHelpHandler<C> {
outer: while (head != null) {
++index;
traversedNodes.add(head.getValue());
if (head.isLeaf()) {
if (head.getValue() != null && head.getValue().getOwningCommand() != null) {
if (head.isLeaf() || index == queryFragments.length) {
return new VerboseHelpTopic<>(head.getValue().getOwningCommand());
} else if (head.getChildren().size() == 1) {
}
}
if (head.getChildren().size() == 1) {
head = head.getChildren().get(0);
} else {
if (index < queryFragments.length) {