summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/attach.go2
-rw-r--r--cmd/podman/build.go2
-rw-r--r--cmd/podman/checkpoint.go2
-rw-r--r--cmd/podman/cleanup.go2
-rw-r--r--cmd/podman/commit.go2
-rw-r--r--cmd/podman/common.go12
-rw-r--r--cmd/podman/create.go2
-rw-r--r--cmd/podman/diff.go2
-rw-r--r--cmd/podman/exec.go2
-rw-r--r--cmd/podman/export.go2
-rw-r--r--cmd/podman/history.go2
-rw-r--r--cmd/podman/images.go2
-rw-r--r--cmd/podman/import.go2
-rw-r--r--cmd/podman/info.go2
-rw-r--r--cmd/podman/inspect.go2
-rw-r--r--cmd/podman/kill.go2
-rw-r--r--cmd/podman/load.go2
-rw-r--r--cmd/podman/login.go2
-rw-r--r--cmd/podman/logout.go2
-rw-r--r--cmd/podman/logs.go2
-rw-r--r--cmd/podman/mount.go2
-rw-r--r--cmd/podman/pod_create.go2
-rw-r--r--cmd/podman/pod_inspect.go2
-rw-r--r--cmd/podman/pod_kill.go2
-rw-r--r--cmd/podman/pod_pause.go2
-rw-r--r--cmd/podman/pod_ps.go2
-rw-r--r--cmd/podman/pod_restart.go2
-rw-r--r--cmd/podman/pod_rm.go2
-rw-r--r--cmd/podman/pod_start.go2
-rw-r--r--cmd/podman/pod_stats.go2
-rw-r--r--cmd/podman/pod_stop.go2
-rw-r--r--cmd/podman/pod_top.go2
-rw-r--r--cmd/podman/pod_unpause.go2
-rw-r--r--cmd/podman/port.go2
-rw-r--r--cmd/podman/ps.go2
-rw-r--r--cmd/podman/pull.go2
-rw-r--r--cmd/podman/push.go2
-rw-r--r--cmd/podman/refresh.go2
-rw-r--r--cmd/podman/restart.go2
-rw-r--r--cmd/podman/restore.go2
-rw-r--r--cmd/podman/rm.go2
-rw-r--r--cmd/podman/rmi.go2
-rw-r--r--cmd/podman/run.go2
-rw-r--r--cmd/podman/run_test.go2
-rw-r--r--cmd/podman/runlabel.go2
-rw-r--r--cmd/podman/save.go2
-rw-r--r--cmd/podman/search.go2
-rw-r--r--cmd/podman/start.go2
-rw-r--r--cmd/podman/stats.go2
-rw-r--r--cmd/podman/stop.go29
-rw-r--r--cmd/podman/top.go2
-rw-r--r--cmd/podman/umount.go2
-rw-r--r--cmd/podman/utils.go48
-rw-r--r--cmd/podman/varlink.go2
-rw-r--r--cmd/podman/wait.go2
55 files changed, 133 insertions, 60 deletions
diff --git a/cmd/podman/attach.go b/cmd/podman/attach.go
index 5b58c022a..dc0563a94 100644
--- a/cmd/podman/attach.go
+++ b/cmd/podman/attach.go
@@ -30,7 +30,7 @@ var (
Name: "attach",
Usage: "Attach to a running container",
Description: attachDescription,
- Flags: attachFlags,
+ Flags: sortFlags(attachFlags),
Action: attachCmd,
ArgsUsage: "",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/build.go b/cmd/podman/build.go
index 1b8a5faec..424f9d471 100644
--- a/cmd/podman/build.go
+++ b/cmd/podman/build.go
@@ -29,7 +29,7 @@ var (
Name: "build",
Usage: "Build an image using instructions from Dockerfiles",
Description: buildDescription,
- Flags: append(append(buildahcli.BudFlags, layerFlags...), buildahcli.FromAndBudFlags...),
+ Flags: sortFlags(append(append(buildahcli.BudFlags, layerFlags...), buildahcli.FromAndBudFlags...)),
Action: buildCmd,
ArgsUsage: "CONTEXT-DIRECTORY | URL",
SkipArgReorder: true,
diff --git a/cmd/podman/checkpoint.go b/cmd/podman/checkpoint.go
index cbbbcd740..8582ce138 100644
--- a/cmd/podman/checkpoint.go
+++ b/cmd/podman/checkpoint.go
@@ -27,7 +27,7 @@ var (
Name: "checkpoint",
Usage: "Checkpoints one or more containers",
Description: checkpointDescription,
- Flags: checkpointFlags,
+ Flags: sortFlags(checkpointFlags),
Action: checkpointCmd,
ArgsUsage: "CONTAINER-NAME [CONTAINER-NAME ...]",
}
diff --git a/cmd/podman/cleanup.go b/cmd/podman/cleanup.go
index 316704f91..3fd150783 100644
--- a/cmd/podman/cleanup.go
+++ b/cmd/podman/cleanup.go
@@ -27,7 +27,7 @@ var (
Name: "cleanup",
Usage: "Cleanup network and mountpoints of one or more containers",
Description: cleanupDescription,
- Flags: cleanupFlags,
+ Flags: sortFlags(cleanupFlags),
Action: cleanupCmd,
ArgsUsage: "CONTAINER-NAME [CONTAINER-NAME ...]",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/commit.go b/cmd/podman/commit.go
index 234926de0..b09c6b0d9 100644
--- a/cmd/podman/commit.go
+++ b/cmd/podman/commit.go
@@ -52,7 +52,7 @@ var (
Name: "commit",
Usage: "Create new image based on the changed container",
Description: commitDescription,
- Flags: commitFlags,
+ Flags: sortFlags(commitFlags),
Action: commitCmd,
ArgsUsage: "CONTAINER [REPOSITORY[:TAG]]",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/common.go b/cmd/podman/common.go
index 9ab0e57e5..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"
@@ -249,6 +250,10 @@ var createFlags = []cli.Flag{
Usage: "Keep STDIN open even if not attached",
},
cli.StringFlag{
+ Name: "ip",
+ Usage: "Specify a static IPv4 address for the container",
+ },
+ cli.StringFlag{
Name: "ipc",
Usage: "IPC namespace to use",
},
@@ -446,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
+}
diff --git a/cmd/podman/create.go b/cmd/podman/create.go
index e442e5c03..248ff1b7d 100644
--- a/cmd/podman/create.go
+++ b/cmd/podman/create.go
@@ -48,7 +48,7 @@ var createCommand = cli.Command{
Name: "create",
Usage: "Create but do not start a container",
Description: createDescription,
- Flags: createFlags,
+ Flags: sortFlags(createFlags),
Action: createCmd,
ArgsUsage: "IMAGE [COMMAND [ARG...]]",
HideHelp: true,
diff --git a/cmd/podman/diff.go b/cmd/podman/diff.go
index dc35ea5a3..5f813699f 100644
--- a/cmd/podman/diff.go
+++ b/cmd/podman/diff.go
@@ -51,7 +51,7 @@ var (
Name: "diff",
Usage: "Inspect changes on container's file systems",
Description: diffDescription,
- Flags: diffFlags,
+ Flags: sortFlags(diffFlags),
Action: diffCmd,
ArgsUsage: "ID-NAME",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/exec.go b/cmd/podman/exec.go
index 38cee67d6..1dcb88dbd 100644
--- a/cmd/podman/exec.go
+++ b/cmd/podman/exec.go
@@ -46,7 +46,7 @@ var (
Name: "exec",
Usage: "Run a process in a running container",
Description: execDescription,
- Flags: execFlags,
+ Flags: sortFlags(execFlags),
Action: execCmd,
ArgsUsage: "CONTAINER-NAME",
SkipArgReorder: true,
diff --git a/cmd/podman/export.go b/cmd/podman/export.go
index dd73c8663..667b8d012 100644
--- a/cmd/podman/export.go
+++ b/cmd/podman/export.go
@@ -23,7 +23,7 @@ var (
Name: "export",
Usage: "Export container's filesystem contents as a tar archive",
Description: exportDescription,
- Flags: exportFlags,
+ Flags: sortFlags(exportFlags),
Action: exportCmd,
ArgsUsage: "CONTAINER",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/history.go b/cmd/podman/history.go
index 35f71dc60..7c8c619c8 100644
--- a/cmd/podman/history.go
+++ b/cmd/podman/history.go
@@ -59,7 +59,7 @@ var (
Name: "history",
Usage: "Show history of a specified image",
Description: historyDescription,
- Flags: historyFlags,
+ Flags: sortFlags(historyFlags),
Action: historyCmd,
ArgsUsage: "",
UseShortOptionHandling: true,
diff --git a/cmd/podman/images.go b/cmd/podman/images.go
index f88ca32fd..a8955e49e 100644
--- a/cmd/podman/images.go
+++ b/cmd/podman/images.go
@@ -124,7 +124,7 @@ var (
Name: "images",
Usage: "List images in local storage",
Description: imagesDescription,
- Flags: imagesFlags,
+ Flags: sortFlags(imagesFlags),
Action: imagesCmd,
ArgsUsage: "",
UseShortOptionHandling: true,
diff --git a/cmd/podman/import.go b/cmd/podman/import.go
index c663e7128..be516e4fa 100644
--- a/cmd/podman/import.go
+++ b/cmd/podman/import.go
@@ -39,7 +39,7 @@ var (
Name: "import",
Usage: "Import a tarball to create a filesystem image",
Description: importDescription,
- Flags: importFlags,
+ Flags: sortFlags(importFlags),
Action: importCmd,
ArgsUsage: "TARBALL [REFERENCE]",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/info.go b/cmd/podman/info.go
index 927bf57be..563e63ba3 100644
--- a/cmd/podman/info.go
+++ b/cmd/podman/info.go
@@ -16,7 +16,7 @@ var (
Name: "info",
Usage: infoDescription,
Description: `Information display here pertain to the host, current storage stats, and build of podman. Useful for the user and when reporting issues.`,
- Flags: infoFlags,
+ Flags: sortFlags(infoFlags),
Action: infoCmd,
ArgsUsage: "",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/inspect.go b/cmd/podman/inspect.go
index f4c460777..bd9e8c13c 100644
--- a/cmd/podman/inspect.go
+++ b/cmd/podman/inspect.go
@@ -41,7 +41,7 @@ var (
Name: "inspect",
Usage: "Displays the configuration of a container or image",
Description: inspectDescription,
- Flags: inspectFlags,
+ Flags: sortFlags(inspectFlags),
Action: inspectCmd,
ArgsUsage: "CONTAINER-OR-IMAGE [CONTAINER-OR-IMAGE]...",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/kill.go b/cmd/podman/kill.go
index db3300984..56dd170b5 100644
--- a/cmd/podman/kill.go
+++ b/cmd/podman/kill.go
@@ -31,7 +31,7 @@ var (
Name: "kill",
Usage: "Kill one or more running containers with a specific signal",
Description: killDescription,
- Flags: killFlags,
+ Flags: sortFlags(killFlags),
Action: killCmd,
ArgsUsage: "CONTAINER-NAME [CONTAINER-NAME ...]",
UseShortOptionHandling: true,
diff --git a/cmd/podman/load.go b/cmd/podman/load.go
index 4dc5c1e3a..f39ee4487 100644
--- a/cmd/podman/load.go
+++ b/cmd/podman/load.go
@@ -36,7 +36,7 @@ var (
Name: "load",
Usage: "Load an image from docker archive",
Description: loadDescription,
- Flags: loadFlags,
+ Flags: sortFlags(loadFlags),
Action: loadCmd,
ArgsUsage: "",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/login.go b/cmd/podman/login.go
index afbd180f8..8625828de 100644
--- a/cmd/podman/login.go
+++ b/cmd/podman/login.go
@@ -43,7 +43,7 @@ var (
Name: "login",
Usage: "Login to a container registry",
Description: loginDescription,
- Flags: loginFlags,
+ Flags: sortFlags(loginFlags),
Action: loginCmd,
ArgsUsage: "REGISTRY",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/logout.go b/cmd/podman/logout.go
index fa77df2ab..d2a2da790 100644
--- a/cmd/podman/logout.go
+++ b/cmd/podman/logout.go
@@ -25,7 +25,7 @@ var (
Name: "logout",
Usage: "Logout of a container registry",
Description: logoutDescription,
- Flags: logoutFlags,
+ Flags: sortFlags(logoutFlags),
Action: logoutCmd,
ArgsUsage: "REGISTRY",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/logs.go b/cmd/podman/logs.go
index 34d062c56..84aca5e61 100644
--- a/cmd/podman/logs.go
+++ b/cmd/podman/logs.go
@@ -43,7 +43,7 @@ var (
Name: "logs",
Usage: "Fetch the logs of a container",
Description: logsDescription,
- Flags: logsFlags,
+ Flags: sortFlags(logsFlags),
Action: logsCmd,
ArgsUsage: "CONTAINER",
SkipArgReorder: true,
diff --git a/cmd/podman/mount.go b/cmd/podman/mount.go
index fbaf2baf1..585f506cd 100644
--- a/cmd/podman/mount.go
+++ b/cmd/podman/mount.go
@@ -36,7 +36,7 @@ var (
Description: mountDescription,
Action: mountCmd,
ArgsUsage: "[CONTAINER-NAME-OR-ID [...]]",
- Flags: mountFlags,
+ Flags: sortFlags(mountFlags),
OnUsageError: usageErrorHandler,
}
)
diff --git a/cmd/podman/pod_create.go b/cmd/podman/pod_create.go
index 61086f890..c3a45a093 100644
--- a/cmd/podman/pod_create.go
+++ b/cmd/podman/pod_create.go
@@ -69,7 +69,7 @@ var podCreateCommand = cli.Command{
Name: "create",
Usage: "Create a new empty pod",
Description: podCreateDescription,
- Flags: podCreateFlags,
+ Flags: sortFlags(podCreateFlags),
Action: podCreateCmd,
SkipArgReorder: true,
UseShortOptionHandling: true,
diff --git a/cmd/podman/pod_inspect.go b/cmd/podman/pod_inspect.go
index 34208336b..77178b14d 100644
--- a/cmd/podman/pod_inspect.go
+++ b/cmd/podman/pod_inspect.go
@@ -19,7 +19,7 @@ var (
Name: "inspect",
Usage: "displays a pod configuration",
Description: podInspectDescription,
- Flags: podInspectFlags,
+ Flags: sortFlags(podInspectFlags),
Action: podInspectCmd,
UseShortOptionHandling: true,
ArgsUsage: "[POD_NAME_OR_ID]",
diff --git a/cmd/podman/pod_kill.go b/cmd/podman/pod_kill.go
index 11a3a9207..c8029eb46 100644
--- a/cmd/podman/pod_kill.go
+++ b/cmd/podman/pod_kill.go
@@ -29,7 +29,7 @@ var (
Name: "kill",
Usage: "Send the specified signal or SIGKILL to containers in pod",
Description: podKillDescription,
- Flags: podKillFlags,
+ Flags: sortFlags(podKillFlags),
Action: podKillCmd,
ArgsUsage: "[POD_NAME_OR_ID]",
UseShortOptionHandling: true,
diff --git a/cmd/podman/pod_pause.go b/cmd/podman/pod_pause.go
index 9eb80cddf..e8de0debc 100644
--- a/cmd/podman/pod_pause.go
+++ b/cmd/podman/pod_pause.go
@@ -25,7 +25,7 @@ var (
Name: "pause",
Usage: "Pause one or more pods",
Description: podPauseDescription,
- Flags: podPauseFlags,
+ Flags: sortFlags(podPauseFlags),
Action: podPauseCmd,
ArgsUsage: "POD-NAME|POD-ID [POD-NAME|POD-ID ...]",
UseShortOptionHandling: true,
diff --git a/cmd/podman/pod_ps.go b/cmd/podman/pod_ps.go
index 85d4e51e2..2030b9b04 100644
--- a/cmd/podman/pod_ps.go
+++ b/cmd/podman/pod_ps.go
@@ -161,7 +161,7 @@ var (
Aliases: []string{"ls", "list"},
Usage: "List pods",
Description: podPsDescription,
- Flags: podPsFlags,
+ Flags: sortFlags(podPsFlags),
Action: podPsCmd,
UseShortOptionHandling: true,
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/pod_restart.go b/cmd/podman/pod_restart.go
index b4a7f9e10..e956b2f70 100644
--- a/cmd/podman/pod_restart.go
+++ b/cmd/podman/pod_restart.go
@@ -23,7 +23,7 @@ var (
Name: "restart",
Usage: "Restart one or more pods",
Description: podRestartDescription,
- Flags: podRestartFlags,
+ Flags: sortFlags(podRestartFlags),
Action: podRestartCmd,
ArgsUsage: "POD-NAME|POD-ID [POD-NAME|POD-ID ...]",
UseShortOptionHandling: true,
diff --git a/cmd/podman/pod_rm.go b/cmd/podman/pod_rm.go
index 09eb9b394..49f2104cf 100644
--- a/cmd/podman/pod_rm.go
+++ b/cmd/podman/pod_rm.go
@@ -30,7 +30,7 @@ If --force is specified, all containers will be stopped, then removed.
Name: "rm",
Usage: "Remove one or more pods",
Description: podRmDescription,
- Flags: podRmFlags,
+ Flags: sortFlags(podRmFlags),
Action: podRmCmd,
ArgsUsage: "[POD ...]",
UseShortOptionHandling: true,
diff --git a/cmd/podman/pod_start.go b/cmd/podman/pod_start.go
index 4735028e0..f0a7926c9 100644
--- a/cmd/podman/pod_start.go
+++ b/cmd/podman/pod_start.go
@@ -27,7 +27,7 @@ var (
Name: "start",
Usage: "Start one or more pods",
Description: podStartDescription,
- Flags: podStartFlags,
+ Flags: sortFlags(podStartFlags),
Action: podStartCmd,
ArgsUsage: "POD-NAME [POD-NAME ...]",
UseShortOptionHandling: true,
diff --git a/cmd/podman/pod_stats.go b/cmd/podman/pod_stats.go
index 0a3c6942b..2e29445b4 100644
--- a/cmd/podman/pod_stats.go
+++ b/cmd/podman/pod_stats.go
@@ -39,7 +39,7 @@ var (
Name: "stats",
Usage: "Display percentage of CPU, memory, network I/O, block I/O and PIDs for containers in one or more pods",
Description: podStatsDescription,
- Flags: podStatsFlags,
+ Flags: sortFlags(podStatsFlags),
Action: podStatsCmd,
ArgsUsage: "[POD_NAME_OR_ID]",
UseShortOptionHandling: true,
diff --git a/cmd/podman/pod_stop.go b/cmd/podman/pod_stop.go
index 6dc6a2b2d..14114aa11 100644
--- a/cmd/podman/pod_stop.go
+++ b/cmd/podman/pod_stop.go
@@ -27,7 +27,7 @@ var (
Name: "stop",
Usage: "Stop one or more pods",
Description: podStopDescription,
- Flags: podStopFlags,
+ Flags: sortFlags(podStopFlags),
Action: podStopCmd,
ArgsUsage: "POD-NAME [POD-NAME ...]",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/pod_top.go b/cmd/podman/pod_top.go
index fe351c707..1bd1287db 100644
--- a/cmd/podman/pod_top.go
+++ b/cmd/podman/pod_top.go
@@ -32,7 +32,7 @@ the latest pod.
Name: "top",
Usage: "Display the running processes of containers in a pod",
Description: podTopDescription,
- Flags: podTopFlags,
+ Flags: sortFlags(podTopFlags),
Action: podTopCmd,
ArgsUsage: "POD-NAME [format descriptors]",
SkipArgReorder: true,
diff --git a/cmd/podman/pod_unpause.go b/cmd/podman/pod_unpause.go
index cdee3cbe7..5256f680c 100644
--- a/cmd/podman/pod_unpause.go
+++ b/cmd/podman/pod_unpause.go
@@ -25,7 +25,7 @@ var (
Name: "unpause",
Usage: "Unpause one or more pods",
Description: podUnpauseDescription,
- Flags: podUnpauseFlags,
+ Flags: sortFlags(podUnpauseFlags),
Action: podUnpauseCmd,
ArgsUsage: "POD-NAME|POD-ID [POD-NAME|POD-ID ...]",
UseShortOptionHandling: true,
diff --git a/cmd/podman/port.go b/cmd/podman/port.go
index b7c88887a..d6497d450 100644
--- a/cmd/podman/port.go
+++ b/cmd/podman/port.go
@@ -29,7 +29,7 @@ var (
Name: "port",
Usage: "List port mappings or a specific mapping for the container",
Description: portDescription,
- Flags: portFlags,
+ Flags: sortFlags(portFlags),
Action: portCmd,
ArgsUsage: "CONTAINER-NAME [mapping]",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index e53afe1bf..32b3a0574 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -182,7 +182,7 @@ var (
Name: "ps",
Usage: "List containers",
Description: psDescription,
- Flags: psFlags,
+ Flags: sortFlags(psFlags),
Action: psCmd,
ArgsUsage: "",
UseShortOptionHandling: true,
diff --git a/cmd/podman/pull.go b/cmd/podman/pull.go
index 902bd867c..097c88536 100644
--- a/cmd/podman/pull.go
+++ b/cmd/podman/pull.go
@@ -54,7 +54,7 @@ specified, the image with the 'latest' tag (if it exists) is pulled
Name: "pull",
Usage: "Pull an image from a registry",
Description: pullDescription,
- Flags: pullFlags,
+ Flags: sortFlags(pullFlags),
Action: pullCmd,
ArgsUsage: "",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/push.go b/cmd/podman/push.go
index d9aa2246b..9f2f41835 100644
--- a/cmd/podman/push.go
+++ b/cmd/podman/push.go
@@ -70,7 +70,7 @@ var (
Name: "push",
Usage: "Push an image to a specified destination",
Description: pushDescription,
- Flags: pushFlags,
+ Flags: sortFlags(pushFlags),
Action: pushCmd,
ArgsUsage: "IMAGE DESTINATION",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/refresh.go b/cmd/podman/refresh.go
index df16ad5f0..b07376170 100644
--- a/cmd/podman/refresh.go
+++ b/cmd/podman/refresh.go
@@ -18,7 +18,7 @@ var (
Name: "refresh",
Usage: "Refresh container state",
Description: refreshDescription,
- Flags: refreshFlags,
+ Flags: sortFlags(refreshFlags),
Action: refreshCmd,
UseShortOptionHandling: true,
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/restart.go b/cmd/podman/restart.go
index d2d0c0fd7..7b48ef24e 100644
--- a/cmd/podman/restart.go
+++ b/cmd/podman/restart.go
@@ -26,7 +26,7 @@ var (
Name: "restart",
Usage: "Restart one or more containers",
Description: restartDescription,
- Flags: restartFlags,
+ Flags: sortFlags(restartFlags),
Action: restartCmd,
ArgsUsage: "CONTAINER [CONTAINER ...]",
UseShortOptionHandling: true,
diff --git a/cmd/podman/restore.go b/cmd/podman/restore.go
index 43ef87ca2..623c4936e 100644
--- a/cmd/podman/restore.go
+++ b/cmd/podman/restore.go
@@ -27,7 +27,7 @@ var (
Name: "restore",
Usage: "Restores one or more containers from a checkpoint",
Description: restoreDescription,
- Flags: restoreFlags,
+ Flags: sortFlags(restoreFlags),
Action: restoreCmd,
ArgsUsage: "CONTAINER-NAME [CONTAINER-NAME ...]",
}
diff --git a/cmd/podman/rm.go b/cmd/podman/rm.go
index caf7a5f36..f64eca6f4 100644
--- a/cmd/podman/rm.go
+++ b/cmd/podman/rm.go
@@ -35,7 +35,7 @@ Running containers will not be removed without the -f option.
Name: "rm",
Usage: "Remove one or more containers",
Description: rmDescription,
- Flags: rmFlags,
+ Flags: sortFlags(rmFlags),
Action: rmCmd,
ArgsUsage: "",
UseShortOptionHandling: true,
diff --git a/cmd/podman/rmi.go b/cmd/podman/rmi.go
index fdeab6b80..c0a0d69df 100644
--- a/cmd/podman/rmi.go
+++ b/cmd/podman/rmi.go
@@ -29,7 +29,7 @@ var (
Description: rmiDescription,
Action: rmiCmd,
ArgsUsage: "IMAGE-NAME-OR-ID [...]",
- Flags: rmiFlags,
+ Flags: sortFlags(rmiFlags),
UseShortOptionHandling: true,
OnUsageError: usageErrorHandler,
}
diff --git a/cmd/podman/run.go b/cmd/podman/run.go
index fbad4237d..e4b25eaf4 100644
--- a/cmd/podman/run.go
+++ b/cmd/podman/run.go
@@ -27,7 +27,7 @@ var runCommand = cli.Command{
Name: "run",
Usage: "Run a command in a new container",
Description: runDescription,
- Flags: runFlags,
+ Flags: sortFlags(runFlags),
Action: runCmd,
ArgsUsage: "IMAGE [COMMAND [ARG...]]",
HideHelp: true,
diff --git a/cmd/podman/run_test.go b/cmd/podman/run_test.go
index 0a79f6ec3..079e570aa 100644
--- a/cmd/podman/run_test.go
+++ b/cmd/podman/run_test.go
@@ -18,7 +18,7 @@ var (
CLI *cli.Context
testCommand = cli.Command{
Name: "test",
- Flags: createFlags,
+ Flags: sortFlags(createFlags),
Action: testCmd,
HideHelp: true,
}
diff --git a/cmd/podman/runlabel.go b/cmd/podman/runlabel.go
index d514a79fc..2d464b949 100644
--- a/cmd/podman/runlabel.go
+++ b/cmd/podman/runlabel.go
@@ -79,7 +79,7 @@ Executes a command as described by a container image label.
Name: "runlabel",
Usage: "Execute the command described by an image label",
Description: runlabelDescription,
- Flags: runlabelFlags,
+ Flags: sortFlags(runlabelFlags),
Action: runlabelCmd,
ArgsUsage: "",
SkipArgReorder: true,
diff --git a/cmd/podman/save.go b/cmd/podman/save.go
index a1e980f34..7edc42e0d 100644
--- a/cmd/podman/save.go
+++ b/cmd/podman/save.go
@@ -53,7 +53,7 @@ var (
Name: "save",
Usage: "Save image to an archive",
Description: saveDescription,
- Flags: saveFlags,
+ Flags: sortFlags(saveFlags),
Action: saveCmd,
ArgsUsage: "",
SkipArgReorder: true,
diff --git a/cmd/podman/search.go b/cmd/podman/search.go
index f64b822fc..49b1b7f7b 100644
--- a/cmd/podman/search.go
+++ b/cmd/podman/search.go
@@ -55,7 +55,7 @@ var (
Name: "search",
Usage: "Search registry for image",
Description: searchDescription,
- Flags: searchFlags,
+ Flags: sortFlags(searchFlags),
Action: searchCmd,
ArgsUsage: "TERM",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/start.go b/cmd/podman/start.go
index a34f6df5d..8cf85405e 100644
--- a/cmd/podman/start.go
+++ b/cmd/podman/start.go
@@ -41,7 +41,7 @@ var (
Name: "start",
Usage: "Start one or more containers",
Description: startDescription,
- Flags: startFlags,
+ Flags: sortFlags(startFlags),
Action: startCmd,
ArgsUsage: "CONTAINER-NAME [CONTAINER-NAME ...]",
UseShortOptionHandling: true,
diff --git a/cmd/podman/stats.go b/cmd/podman/stats.go
index 0e1d2a9c6..dea351e88 100644
--- a/cmd/podman/stats.go
+++ b/cmd/podman/stats.go
@@ -52,7 +52,7 @@ var (
Name: "stats",
Usage: "Display percentage of CPU, memory, network I/O, block I/O and PIDs for one or more containers",
Description: statsDescription,
- Flags: statsFlags,
+ Flags: sortFlags(statsFlags),
Action: statsCmd,
ArgsUsage: "",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/stop.go b/cmd/podman/stop.go
index d2fa87730..ff0b36bf1 100644
--- a/cmd/podman/stop.go
+++ b/cmd/podman/stop.go
@@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
+ rt "runtime"
"github.com/containers/libpod/cmd/podman/libpodruntime"
"github.com/containers/libpod/libpod"
@@ -35,7 +36,7 @@ var (
Name: "stop",
Usage: "Stop one or more containers",
Description: stopDescription,
- Flags: stopFlags,
+ Flags: sortFlags(stopFlags),
Action: stopCmd,
ArgsUsage: "CONTAINER-NAME [CONTAINER-NAME ...]",
OnUsageError: usageErrorHandler,
@@ -98,21 +99,33 @@ func stopCmd(c *cli.Context) error {
}
}
+ var stopFuncs []workerInput
for _, ctr := range containers {
+ con := ctr
var stopTimeout uint
if c.IsSet("timeout") {
stopTimeout = c.Uint("timeout")
} else {
stopTimeout = ctr.StopTimeout()
}
- if err := ctr.StopWithTimeout(stopTimeout); err != nil && err != libpod.ErrCtrStopped {
- if lastError != nil {
- fmt.Fprintln(os.Stderr, lastError)
- }
- lastError = errors.Wrapf(err, "failed to stop container %v", ctr.ID())
- } else {
- fmt.Println(ctr.ID())
+ f := func() error {
+ return con.StopWithTimeout(stopTimeout)
+ }
+ stopFuncs = append(stopFuncs, workerInput{
+ containerID: con.ID(),
+ parallelFunc: f,
+ })
+ }
+
+ stopErrors := parallelExecuteWorkerPool(rt.NumCPU()*3, stopFuncs)
+
+ for cid, result := range stopErrors {
+ if result != nil && result != libpod.ErrCtrStopped {
+ fmt.Println(result.Error())
+ lastError = result
+ continue
}
+ fmt.Println(cid)
}
return lastError
}
diff --git a/cmd/podman/top.go b/cmd/podman/top.go
index 9b5c3afae..3012265ea 100644
--- a/cmd/podman/top.go
+++ b/cmd/podman/top.go
@@ -42,7 +42,7 @@ the latest container.
Name: "top",
Usage: "Display the running processes of a container",
Description: topDescription,
- Flags: topFlags,
+ Flags: sortFlags(topFlags),
Action: topCmd,
ArgsUsage: "CONTAINER-NAME [format descriptors]",
SkipArgReorder: true,
diff --git a/cmd/podman/umount.go b/cmd/podman/umount.go
index b6837fb5b..24f0f178b 100644
--- a/cmd/podman/umount.go
+++ b/cmd/podman/umount.go
@@ -35,7 +35,7 @@ An unmount can be forced with the --force flag.
Aliases: []string{"unmount"},
Usage: "Unmounts working container's root filesystem",
Description: description,
- Flags: umountFlags,
+ Flags: sortFlags(umountFlags),
Action: umountCmd,
ArgsUsage: "CONTAINER-NAME-OR-ID",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go
index 89ec48dbe..1b767532e 100644
--- a/cmd/podman/utils.go
+++ b/cmd/podman/utils.go
@@ -5,6 +5,7 @@ import (
"fmt"
"os"
gosignal "os/signal"
+ "sync"
"github.com/containers/libpod/libpod"
"github.com/docker/docker/pkg/signal"
@@ -215,3 +216,50 @@ func getPodsFromContext(c *cli.Context, r *libpod.Runtime) ([]*libpod.Pod, error
}
return pods, lastError
}
+
+type pFunc func() error
+
+type workerInput struct {
+ containerID string
+ parallelFunc pFunc
+}
+
+// worker is a "threaded" worker that takes jobs from the channel "queue"
+func worker(wg *sync.WaitGroup, jobs <-chan workerInput, results map[string]error) {
+ for j := range jobs {
+ err := j.parallelFunc()
+ results[j.containerID] = err
+ wg.Done()
+ }
+}
+
+// parallelExecuteWorkerPool takes container jobs and performs them in parallel. The worker
+// int is determines how many workers/threads should be premade.
+func parallelExecuteWorkerPool(workers int, functions []workerInput) map[string]error {
+ var (
+ wg sync.WaitGroup
+ )
+ results := make(map[string]error)
+ paraJobs := make(chan workerInput, len(functions))
+
+ // If we have more workers than functions, match up the number of workers and functions
+ if workers > len(functions) {
+ workers = len(functions)
+ }
+
+ // Create the workers
+ for w := 1; w <= workers; w++ {
+ go worker(&wg, paraJobs, results)
+ }
+
+ // Add jobs to the workers
+ for _, j := range functions {
+ j := j
+ wg.Add(1)
+ paraJobs <- j
+ }
+
+ close(paraJobs)
+ wg.Wait()
+ return results
+}
diff --git a/cmd/podman/varlink.go b/cmd/podman/varlink.go
index 2f92d9adb..a7c195041 100644
--- a/cmd/podman/varlink.go
+++ b/cmd/podman/varlink.go
@@ -32,7 +32,7 @@ var (
Name: "varlink",
Usage: "Run varlink interface",
Description: varlinkDescription,
- Flags: varlinkFlags,
+ Flags: sortFlags(varlinkFlags),
Action: varlinkCmd,
ArgsUsage: "VARLINK_URI",
OnUsageError: usageErrorHandler,
diff --git a/cmd/podman/wait.go b/cmd/podman/wait.go
index 07db20eee..35ad7a662 100644
--- a/cmd/podman/wait.go
+++ b/cmd/podman/wait.go
@@ -28,7 +28,7 @@ var (
Name: "wait",
Usage: "Block on one or more containers",
Description: waitDescription,
- Flags: waitFlags,
+ Flags: sortFlags(waitFlags),
Action: waitCmd,
ArgsUsage: "CONTAINER-NAME [CONTAINER-NAME ...]",
OnUsageError: usageErrorHandler,