From daa28349c8cfadc53de96a851b7d1d71de7b14e9 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Sat, 1 Sep 2018 20:17:14 +0200 Subject: commandNotFoundHandler: use stderr and exit code 1 Fixes: #1395 Signed-off-by: Valentin Rothberg Closes: #1397 Approved by: mheon --- cmd/podman/common.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/podman/common.go b/cmd/podman/common.go index 43a0fe061..c3b20b7f0 100644 --- a/cmd/podman/common.go +++ b/cmd/podman/common.go @@ -3,6 +3,7 @@ package main import ( "context" "fmt" + "os" "reflect" "regexp" "strings" @@ -52,7 +53,8 @@ func usageErrorHandler(context *cli.Context, err error, _ bool) error { } func commandNotFoundHandler(context *cli.Context, command string) { - fmt.Fprintf(context.App.Writer, "Command %q not found.\nSee `%s --help`.\n", command, context.App.Name) + fmt.Fprintf(os.Stderr, "Command %q not found.\nSee `%s --help`.\n", command, context.App.Name) + os.Exit(1) } // validateFlags searches for StringFlags or StringSlice flags that never had -- cgit v1.2.3-54-g00ecf