summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/login.go2
-rw-r--r--cmd/podman/logout.go2
-rw-r--r--test/system/015-help.bats21
3 files changed, 19 insertions, 6 deletions
diff --git a/cmd/podman/login.go b/cmd/podman/login.go
index 1843a764d..9de805d15 100644
--- a/cmd/podman/login.go
+++ b/cmd/podman/login.go
@@ -19,7 +19,7 @@ type loginOptionsWrapper struct {
var (
loginOptions = loginOptionsWrapper{}
loginCommand = &cobra.Command{
- Use: "login [flags] REGISTRY",
+ Use: "login [flags] [REGISTRY]",
Short: "Login to a container registry",
Long: "Login to a container registry on a specified server.",
RunE: login,
diff --git a/cmd/podman/logout.go b/cmd/podman/logout.go
index 77bdc92b4..c21711fc0 100644
--- a/cmd/podman/logout.go
+++ b/cmd/podman/logout.go
@@ -14,7 +14,7 @@ import (
var (
logoutOptions = auth.LogoutOptions{}
logoutCommand = &cobra.Command{
- Use: "logout [flags] REGISTRY",
+ Use: "logout [flags] [REGISTRY]",
Short: "Logout of a container registry",
Long: "Remove the cached username and password for the registry.",
RunE: logout,
diff --git a/test/system/015-help.bats b/test/system/015-help.bats
index fd4be87b2..231e52195 100644
--- a/test/system/015-help.bats
+++ b/test/system/015-help.bats
@@ -55,11 +55,24 @@ function check_help() {
# If usage has required arguments, try running without them
if expr "$usage" : '.*\[flags\] [A-Z]' >/dev/null; then
- if [ "$cmd" != "stats"]; then
- dprint "podman $@ $cmd (without required args)"
- run_podman 125 "$@" $cmd
- is "$output" "Error:"
+ # Exceptions: these commands don't work rootless
+ if is_rootless; then
+ # "pause is not supported for rootless containers"
+ if [ "$cmd" = "pause" -o "$cmd" = "unpause" ]; then
+ continue
+ fi
+ # "network rm" too
+ if [ "$@" = "network" -a "$cmd" = "rm" ]; then
+ continue
+ fi
fi
+
+ # The </dev/null protects us from 'podman login' which will
+ # try to read username/password from stdin.
+ dprint "podman $@ $cmd (without required args)"
+ run_podman 125 "$@" $cmd </dev/null
+ is "$output" "Error:.* \(require\|specif\|must\|provide\|need\|choose\)" \
+ "'podman $@ $cmd' without required arg"
fi
count=$(expr $count + 1)