From c51e3b3ec9430d67fa208bfcf02ea1481f993d45 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Tue, 9 Jun 2020 16:52:04 +0100 Subject: [PATCH] Return 1 as exit code when the cmd is unknown (#3249) --- cmd/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index b956ccc2..a6c646da 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -355,7 +355,7 @@ func registerApp(name string) *cli.App { app := cli.NewApp() app.Name = name - app.Action = func(ctx *cli.Context) { + app.Action = func(ctx *cli.Context) error { if strings.HasPrefix(ReleaseTag, "RELEASE.") { // Check for new updates from dl.min.io. checkUpdate(ctx) @@ -364,10 +364,11 @@ func registerApp(name string) *cli.App { if ctx.Bool("autocompletion") || ctx.GlobalBool("autocompletion") { // Install shell completions installAutoCompletion() - return + return nil } cli.ShowAppHelp(ctx) + return exitStatus(globalErrorExitStatus) } app.Before = registerBefore