summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@suse.com>2018-09-01 20:17:14 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-09-01 19:26:24 +0000
commitdaa28349c8cfadc53de96a851b7d1d71de7b14e9 (patch)
tree31b300c318fddcc89d5d6540cff6751a5d61c63e
parent4a910e1c2b0cebce8365ffa9555947e7ee30b5ca (diff)
downloadpodman-daa28349c8cfadc53de96a851b7d1d71de7b14e9.tar.gz
podman-daa28349c8cfadc53de96a851b7d1d71de7b14e9.tar.bz2
podman-daa28349c8cfadc53de96a851b7d1d71de7b14e9.zip
commandNotFoundHandler: use stderr and exit code 1
Fixes: #1395 Signed-off-by: Valentin Rothberg <vrothberg@suse.com> Closes: #1397 Approved by: mheon
-rw-r--r--cmd/podman/common.go4
1 files changed, 3 insertions, 1 deletions
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