sort custom column print flags

This commit is contained in:
kkkkun 2022-03-03 22:31:58 +08:00
parent 267272efe0
commit 36ed148761

View File

@ -19,6 +19,7 @@ package get
import ( import (
"fmt" "fmt"
"os" "os"
"sort"
"strings" "strings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -45,6 +46,7 @@ func (f *CustomColumnsPrintFlags) AllowedFormats() []string {
for format := range columnsFormats { for format := range columnsFormats {
formats = append(formats, format) formats = append(formats, format)
} }
sort.Strings(formats)
return formats return formats
} }