summaryrefslogtreecommitdiff
path: root/cmd/podman/common.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-10-11 11:25:41 -0700
committerGitHub <noreply@github.com>2018-10-11 11:25:41 -0700
commit6d8bc879cbcb6673043084658e0facc1752736ad (patch)
tree8f30a057ea8930f3db45eb68e5a821789a014418 /cmd/podman/common.go
parente8172b334e1664a940118e2a2ad8c9f3fcfdfd5c (diff)
parentd73600626d20d1c022610b5fc39eb35606bb3998 (diff)
downloadpodman-6d8bc879cbcb6673043084658e0facc1752736ad.tar.gz
podman-6d8bc879cbcb6673043084658e0facc1752736ad.tar.bz2
podman-6d8bc879cbcb6673043084658e0facc1752736ad.zip
Merge pull request #1619 from QiWang19/issus1610
Sort all CLI flags in podman commands
Diffstat (limited to 'cmd/podman/common.go')
-rw-r--r--cmd/podman/common.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/podman/common.go b/cmd/podman/common.go
index c1e15e2fb..1e7f8d4d8 100644
--- a/cmd/podman/common.go
+++ b/cmd/podman/common.go
@@ -6,6 +6,7 @@ import (
"os"
"reflect"
"regexp"
+ "sort"
"strings"
"github.com/containers/buildah"
@@ -450,3 +451,10 @@ func getFormat(c *cli.Context) (string, error) {
}
return "", errors.Errorf("unrecognized image type %q", format)
}
+
+func sortFlags(flags []cli.Flag) []cli.Flag {
+ sort.Slice(flags, func(i, j int) bool {
+ return strings.Compare(flags[i].GetName(), flags[j].GetName()) < 0
+ })
+ return flags
+}