aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Aschan <[email protected]>2025-08-29 22:13:14 +0200
committerTomas Aschan <[email protected]>2025-08-29 22:13:14 +0200
commitb55ffb6b7ca272b5085317ae58e4631a0f90199d (patch)
tree9dae445b702a32eb21612c4f18448f9e540dc81c
parent7c651d1d398142c3056ff45df14f2019bad2146d (diff)
fix: Don't print ErrHelp in ParseAll
This is a fixup of #407 to ensure behavior of ExitOnError is consistent.
-rw-r--r--flag.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/flag.go b/flag.go
index 2b21b6f..181468f 100644
--- a/flag.go
+++ b/flag.go
@@ -1202,6 +1202,9 @@ func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string)
case ContinueOnError:
return err
case ExitOnError:
+ if err == ErrHelp {
+ os.Exit(0)
+ }
fmt.Fprintln(f.Output(), err)
os.Exit(2)
case PanicOnError: