diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2019-03-07 16:44:39 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2019-03-08 07:06:50 -0500 |
commit | 181f327d57ab84918572b69d2a039c43a8d7b871 (patch) | |
tree | 8684876407aa37f6cd4de1734289161c7c070517 /cmd/podman/main.go | |
parent | 94e89fc6cac0ac67db9228967f0340b60235bed8 (diff) | |
download | podman-181f327d57ab84918572b69d2a039c43a8d7b871.tar.gz podman-181f327d57ab84918572b69d2a039c43a8d7b871.tar.bz2 podman-181f327d57ab84918572b69d2a039c43a8d7b871.zip |
More cleanup for failures on missing commands.
Currently in podman if a user specifies a command that does not exist
the tool shows the help information. This patch changes it to show
information like:
$ ./bin/podman foobar
Error: unrecognized command 'podman foobar'
Try 'podman --help' for more information.
$ ./bin/podman volume foobar
Error: unrecognized command `podman volume foobar`
Try 'podman volume --help' for more information.
$ ./bin/podman container foobar
Error: unrecognized command `podman container foobar`
Try 'podman container --help' for more information.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/main.go')
-rw-r--r-- | cmd/podman/main.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go index 97ffa8930..7d4b650a9 100644 --- a/cmd/podman/main.go +++ b/cmd/podman/main.go @@ -82,9 +82,7 @@ var cmdsNotRequiringRootless = map[*cobra.Command]bool{ var rootCmd = &cobra.Command{ Use: "podman", Long: "manage pods and images", - RunE: func(cmd *cobra.Command, args []string) error { - return cmd.Help() - }, + RunE: commandRunE(), PersistentPreRunE: func(cmd *cobra.Command, args []string) error { return before(cmd, args) }, |