mirror of
https://github.com/containers/podman.git
synced 2025-12-08 06:39:05 +08:00
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>
This commit is contained in:
@@ -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)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user