diff options
Diffstat (limited to 'cmd/podman/common.go')
-rw-r--r-- | cmd/podman/common.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/podman/common.go b/cmd/podman/common.go index 4ddfd5e0a..3d0f1159f 100644 --- a/cmd/podman/common.go +++ b/cmd/podman/common.go @@ -2,6 +2,7 @@ package main import ( "context" + "fmt" "reflect" "regexp" "strings" @@ -42,6 +43,14 @@ func shortID(id string) string { return id } +func usageErrorHandler(context *cli.Context, err error, _ bool) error { + cmd := context.App.Name + if len(context.Command.Name) > 0 { + cmd = cmd + " " + context.Command.Name + } + return fmt.Errorf("%s\nSee '%s --help'.", err, cmd) +} + // validateFlags searches for StringFlags or StringSlice flags that never had // a value set. This commonly occurs when the CLI mistakenly takes the next // option and uses it as a value. |