mirror of https://github.com/docker/cli.git
use sortorder lib for sorting network list output
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
This commit is contained in:
parent
1d04f7d66b
commit
a921313caf
|
@ -10,6 +10,7 @@ import (
|
||||||
"github.com/docker/cli/opts"
|
"github.com/docker/cli/opts"
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"vbom.ml/util/sortorder"
|
||||||
)
|
)
|
||||||
|
|
||||||
type listOptions struct {
|
type listOptions struct {
|
||||||
|
@ -59,7 +60,7 @@ func runList(dockerCli command.Cli, options listOptions) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
sort.Slice(networkResources, func(i, j int) bool {
|
sort.Slice(networkResources, func(i, j int) bool {
|
||||||
return networkResources[i].Name < networkResources[j].Name
|
return sortorder.NaturalLess(networkResources[i].Name, networkResources[j].Name)
|
||||||
})
|
})
|
||||||
|
|
||||||
networksCtx := formatter.Context{
|
networksCtx := formatter.Context{
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
network-1-foo
|
network-1-foo
|
||||||
network-10-foo
|
|
||||||
network-2-foo
|
network-2-foo
|
||||||
|
network-10-foo
|
||||||
|
|
Loading…
Reference in New Issue