summaryrefslogtreecommitdiff
path: root/cmd/podman/common.go
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2018-10-09 16:06:45 -0400
committerQi Wang <qiwan@redhat.com>2018-10-11 13:17:14 -0400
commitd73600626d20d1c022610b5fc39eb35606bb3998 (patch)
treeb1127660963fad0114bba4a9f61d77e800092095 /cmd/podman/common.go
parentb5f4bb15a5569ba6cf3517c3c979c75ad205ada5 (diff)
downloadpodman-d73600626d20d1c022610b5fc39eb35606bb3998.tar.gz
podman-d73600626d20d1c022610b5fc39eb35606bb3998.tar.bz2
podman-d73600626d20d1c022610b5fc39eb35606bb3998.zip
Sort all command flags
Signed-off-by: Qi Wang <qiwan@redhat.com>
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 9ab0e57e5..838bbfc4f 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"
@@ -446,3 +447,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
+}