Skip to content

Commit

Permalink
feat(cli): sort environments by name (#521)
Browse files Browse the repository at this point in the history
* feat(cli): sort environments by name


Co-authored-by: sh0rez <me@shorez.de>
  • Loading branch information
Duologic and sh0rez authored Feb 22, 2021
1 parent e5bf9fd commit f88c104
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/tk/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path/filepath"
"sort"
"text/tabwriter"

"github.com/go-clix/cli"
Expand Down Expand Up @@ -248,6 +249,7 @@ func envListCmd() *cli.Command {
if err != nil {
return err
}
sort.SliceStable(envs, func(i, j int) bool { return envs[i].Metadata.Name < envs[j].Metadata.Name })

if *useJSON {
j, err := json.Marshal(envs)
Expand Down

0 comments on commit f88c104

Please sign in to comment.