summaryrefslogtreecommitdiff
path: root/cmd/podman/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/common.go')
-rw-r--r--cmd/podman/common.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/cmd/podman/common.go b/cmd/podman/common.go
index f9dfa3759..c9e937825 100644
--- a/cmd/podman/common.go
+++ b/cmd/podman/common.go
@@ -59,6 +59,14 @@ func checkAllAndLatest(c *cobra.Command, args []string, ignoreArgLen bool) error
return nil
}
+// noSubArgs checks that there are no further positional parameters
+func noSubArgs(c *cobra.Command, args []string) error {
+ if len(args) > 0 {
+ return errors.Errorf("`%s` takes no arguments", c.CommandPath())
+ }
+ return nil
+}
+
// getAllOrLatestContainers tries to return the correct list of containers
// depending if --all, --latest or <container-id> is used.
// It requires the Context (c) and the Runtime (runtime). As different
@@ -303,8 +311,8 @@ func getCreateFlags(c *cliconfig.PodmanCommand) {
"kernel-memory", "",
"Kernel memory limit (format: `<number>[<unit>]`, where unit = b, k, m or g)",
)
- createFlags.StringSlice(
- "label", []string{},
+ createFlags.StringSliceP(
+ "label", "l", []string{},
"Set metadata on container (default [])",
)
createFlags.StringSlice(
@@ -519,7 +527,6 @@ func scrubServer(server string) string {
func UsageTemplate() string {
return `Usage:{{if .Runnable}}
{{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
-
{{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}}
Aliases: