aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/system
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2020-06-23 08:10:08 -0600
committerEd Santiago <santiago@redhat.com>2020-06-23 14:17:48 -0600
commit6864a5547a774d19a7ccb9d50a7799b721fb66ef (patch)
tree1a74a2005e9fc1da7d0aa89508233cd4ba186bbc /cmd/podman/system
parent81f4204e4e0c8074e2709bd7c4db3f1f61d1b351 (diff)
downloadpodman-6864a5547a774d19a7ccb9d50a7799b721fb66ef.tar.gz
podman-6864a5547a774d19a7ccb9d50a7799b721fb66ef.tar.bz2
podman-6864a5547a774d19a7ccb9d50a7799b721fb66ef.zip
BATS tests: new too-many-arguments test
...plus a few others. And fixes to actual parsing. If a command's usage message includes '...' in the argument list, assume it can take unlimited arguments. Nothing we can check. For all others, though, the ALL-CAPS part on the right-hand side of the usage message will define an upper bound on the number of arguments accepted by the command. So in our 'podman --help' test, generate N+1 args and run that command. We expect a 125 exit status and a suitably helpful error message. Not all podman commands or subcommands were checking, so I fixed that. And, fixed some broken usage messages (all-caps FLAGS, and '[flags]' at the end of 'ARGS'). Add new checks to the help test to prevent those in the future. Plus a little refactoring/cleanup where necessary. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'cmd/podman/system')
-rw-r--r--cmd/podman/system/connection.go2
-rw-r--r--cmd/podman/system/unshare.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/cmd/podman/system/connection.go b/cmd/podman/system/connection.go
index d8c709d6e..f19af2ccf 100644
--- a/cmd/podman/system/connection.go
+++ b/cmd/podman/system/connection.go
@@ -29,7 +29,7 @@ var (
return nil
}
connectionCmd = &cobra.Command{
- Use: "connection [flags] destination",
+ Use: "connection [flags] DESTINATION",
Args: cobra.ExactArgs(1),
Long: `Store ssh destination information in podman configuration.
"destination" is of the form [user@]hostname or
diff --git a/cmd/podman/system/unshare.go b/cmd/podman/system/unshare.go
index 7db5d36d2..e5d41e06d 100644
--- a/cmd/podman/system/unshare.go
+++ b/cmd/podman/system/unshare.go
@@ -13,7 +13,7 @@ import (
var (
unshareDescription = "Runs a command in a modified user namespace."
unshareCommand = &cobra.Command{
- Use: "unshare [flags] [COMMAND [ARG]]",
+ Use: "unshare [flags] [COMMAND [ARG ...]]",
Short: "Run a command in a modified user namespace",
Long: unshareDescription,
RunE: unshare,