Skip to content

Commit

Permalink
Builtins title is shown in command help without commands, fixes #546
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Jun 19, 2020
1 parent 6c81a5b commit 66fcd73
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,7 @@ private void helpTopic(List<String> topics) {
printCommands(systemCommands.keySet(), max);
}
}
if (isInTopics(topics, "Builtins")) {
if (isInTopics(topics, "Builtins") && !builtinCommands.isEmpty()) {
printHeader("Builtins");
if (withInfo) {
for (Map.Entry<String, String> entry : builtinCommands.entrySet()) {
Expand All @@ -1400,7 +1400,7 @@ private void helpTopic(List<String> topics) {
}
}
for (CommandRegistry r : commandRegistries) {
if (isBuiltinRegistry(r) || !isInTopics(topics, r.name())) {
if (isBuiltinRegistry(r) || !isInTopics(topics, r.name()) || r.commandNames().isEmpty()) {
continue;
}
TreeSet<String> cmds = new TreeSet<>(r.commandNames());
Expand All @@ -1413,7 +1413,7 @@ private void helpTopic(List<String> topics) {
printCommands(cmds, max);
}
}
if (consoleId != null && isInTopics(topics, "Scripts")) {
if (consoleId != null && isInTopics(topics, "Scripts") && !scriptStore.getScripts().isEmpty()) {
printHeader("Scripts");
if (withInfo) {
for (String c : scriptStore.getScripts()) {
Expand Down

0 comments on commit 66fcd73

Please sign in to comment.