From e9d90445b628a43e4a40317dd4b3a51ff7720180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20N=C3=BCtzi?= Date: Tue, 29 Dec 2020 13:31:06 +0100 Subject: [PATCH] Requesting help in case of an error needs exit code > 0 Returning nil, when flag.ErrHelp is returned, should really not exit with '0'. --- command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command.go b/command.go index 2b82a553d..4e3d64df2 100644 --- a/command.go +++ b/command.go @@ -961,7 +961,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { // effect if err == flag.ErrHelp { cmd.HelpFunc()(cmd, args) - return cmd, nil + return cmd, err } // If root command has SilenceErrors flagged,