diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-02-23 16:43:02 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-23 16:43:02 -0500 |
commit | 49d511b6ee88ceff70cc6786c467bed39da35a61 (patch) | |
tree | 3e0556416de59ee73fadde87f93a450b83199c86 /cmd/podman/main.go | |
parent | 172b745d0e796327cc23c19e61973365bb1488ef (diff) | |
parent | cfcc0d6398b2bbddace991ba36d92c631f2b5f45 (diff) | |
download | podman-49d511b6ee88ceff70cc6786c467bed39da35a61.tar.gz podman-49d511b6ee88ceff70cc6786c467bed39da35a61.tar.bz2 podman-49d511b6ee88ceff70cc6786c467bed39da35a61.zip |
Merge pull request #13329 from mheon/bump_401
Bump to v4.0.1
Diffstat (limited to 'cmd/podman/main.go')
-rw-r--r-- | cmd/podman/main.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go index 9850f5d27..4f8131653 100644 --- a/cmd/podman/main.go +++ b/cmd/podman/main.go @@ -72,6 +72,8 @@ func parseCommands() *cobra.Command { } parent.AddCommand(c.Command) + c.Command.SetFlagErrorFunc(flagErrorFuncfunc) + // - templates need to be set here, as PersistentPreRunE() is // not called when --help is used. // - rootCmd uses cobra default template not ours @@ -84,5 +86,11 @@ func parseCommands() *cobra.Command { os.Exit(1) } + rootCmd.SetFlagErrorFunc(flagErrorFuncfunc) return rootCmd } + +func flagErrorFuncfunc(c *cobra.Command, e error) error { + e = fmt.Errorf("%w\nSee '%s --help'", e, c.CommandPath()) + return e +} |