1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-12-27 17:55:47 +01:00

Sort output of list-users and list-groups.

This commit is contained in:
Juliusz Chroboczek 2024-10-27 15:05:11 +01:00
parent 8446a39efc
commit de09706edd

View file

@ -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)
}