Skip to content

Commit 99035e0

Browse files
authored
Sort clients in the client setup command (#2551)
Signed-off-by: Dan Barr <6922515+danbarr@users.noreply.github.com> Co-authored-by: Dan Barr <6922515+danbarr@users.noreply.github.com>
1 parent 830b431 commit 99035e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/thv/app/client.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package app
33
import (
44
"context"
55
"fmt"
6+
"sort"
67

78
"github.com/spf13/cobra"
89

@@ -136,6 +137,11 @@ func clientSetupCmdFunc(cmd *cobra.Command, _ []string) error {
136137
fmt.Println("No new clients found.")
137138
return nil
138139
}
140+
141+
// Sort clients alphabetically by ClientType
142+
sort.Slice(availableClients, func(i, j int) bool {
143+
return availableClients[i].ClientType < availableClients[j].ClientType
144+
})
139145
// Get available groups for the UI
140146
groupManager, err := groups.NewManager()
141147
if err != nil {

0 commit comments

Comments
 (0)