From de09706edd45a53cf1ffc8488dd968d341c4267c Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sun, 27 Oct 2024 15:05:11 +0100 Subject: [PATCH] Sort output of list-users and list-groups. --- galenectl/galenectl.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/galenectl/galenectl.go b/galenectl/galenectl.go index ec0c566..0b93b82 100644 --- a/galenectl/galenectl.go +++ b/galenectl/galenectl.go @@ -716,6 +716,9 @@ func listUsersCmd(cmdname string, args []string) { if err != nil { log.Fatalf("Get users: %v", err) } + sort.Slice(users, func(i, j int) bool { + return users[i] < users[j] + }) for _, user := range users { fmt.Println(user) } @@ -904,6 +907,9 @@ func listGroupsCmd(cmdname string, args []string) { if err != nil { log.Fatalf("Get groups: %v", err) } + sort.Slice(groups, func(i, j int) bool { + return groups[i] < groups[j] + }) for _, g := range groups { fmt.Println(g) }