Skip to content

Commit 7d41bba

Browse files
committed
limactl --list-fields should list them in sort order
Signed-off-by: Jan Dubois <[email protected]>
1 parent 67e465e commit 7d41bba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/limactl/list.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"fmt"
77
"reflect"
8+
"sort"
89
"strings"
910
"text/tabwriter"
1011
"text/template"
@@ -78,7 +79,9 @@ func listAction(cmd *cobra.Command, args []string) error {
7879
return errors.New("option --json conflicts with --list-fields")
7980
}
8081
if listFields {
81-
fmt.Println(strings.Join(instanceFields(), "\n"))
82+
fields := instanceFields()
83+
sort.Strings(fields)
84+
fmt.Println(strings.Join(fields, "\n"))
8285
return nil
8386
}
8487
if quiet && jsonFormat {

0 commit comments

Comments
 (0)