Skip to content

Commit b55ffb6

Browse files
committed
fix: Don't print ErrHelp in ParseAll
This is a fixup of #407 to ensure behavior of ExitOnError is consistent.
1 parent 7c651d1 commit b55ffb6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

flag.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,9 @@ func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string)
12021202
case ContinueOnError:
12031203
return err
12041204
case ExitOnError:
1205+
if err == ErrHelp {
1206+
os.Exit(0)
1207+
}
12051208
fmt.Fprintln(f.Output(), err)
12061209
os.Exit(2)
12071210
case PanicOnError:

0 commit comments

Comments
 (0)