Commit 2bc26fc 1 parent 98dcd36 commit 2bc26fc Copy full SHA for 2bc26fc
File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,12 @@ package main
3
3
import (
4
4
"fmt"
5
5
"os"
6
+ "slices"
6
7
7
8
"github.com/olekukonko/tablewriter"
8
9
"github.com/pterm/pterm"
9
10
"github.com/spf13/pflag"
11
+ "golang.org/x/exp/maps"
10
12
11
13
"github.com/errata-ai/vale/v3/internal/core"
12
14
)
@@ -105,10 +107,13 @@ func init() {
105
107
table .Render ()
106
108
table .ClearRows ()
107
109
110
+ commandKeys := maps .Keys (commandInfo )
111
+ slices .Sort (commandKeys )
112
+
108
113
fmt .Println (pterm .Bold .Sprintf ("Commands:" ))
109
- for cmd , use := range commandInfo {
114
+ for _ , cmd := range commandKeys {
110
115
if ! core .StringInSlice (cmd , hidden ) {
111
- table .Append ([]string {toCodeStyle (cmd ), use })
116
+ table .Append ([]string {toCodeStyle (cmd ), commandInfo [ cmd ] })
112
117
}
113
118
}
114
119
table .Render ()
You can’t perform that action at this time.
0 commit comments