mirror of
https://github.com/openziti/zrok.git
synced 2024-11-22 08:03:49 +01:00
sort objects list (#438)
This commit is contained in:
parent
3ccbfe2829
commit
6a1f429749
@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
"sort"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -55,6 +56,9 @@ func (cmd *dirCommand) run(_ *cobra.Command, args []string) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
tui.Error("error listing directory", err)
|
tui.Error("error listing directory", err)
|
||||||
}
|
}
|
||||||
|
sort.Slice(objects, func(i, j int) bool {
|
||||||
|
return objects[i].Path < objects[j].Path
|
||||||
|
})
|
||||||
|
|
||||||
tw := table.NewWriter()
|
tw := table.NewWriter()
|
||||||
tw.SetOutputMirror(os.Stdout)
|
tw.SetOutputMirror(os.Stdout)
|
||||||
|
Loading…
Reference in New Issue
Block a user