Skip to content

Commit e59e7a1

Browse files
Sort command names in help output
1 parent d714902 commit e59e7a1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • spring-shell-core/src/main/java/org/springframework/shell/core/utils

spring-shell-core/src/main/java/org/springframework/shell/core/utils/Utils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.shell.core.utils;
1818

19+
import java.util.Comparator;
1920
import java.util.HashSet;
2021
import java.util.List;
2122
import java.util.Set;
@@ -89,6 +90,7 @@ public static String formatAvailableCommands(CommandRegistry commandRegistry) {
8990
for (Command command : commands.stream()
9091
.filter(c -> !c.isHidden())
9192
.filter(c -> c.getGroup().equals(group))
93+
.sorted(Comparator.comparing(Command::getName))
9294
.toList()) {
9395
stringBuilder.append("\t")
9496
.append(command.getName())

0 commit comments

Comments
 (0)