Skip to content

Commit bb2569d

Browse files
authored
refactor: bump pflag to v1.0.10 which includes the fix to stop printing ErrHelp (#98)
This reverts commit 80b6daf (#95).
1 parent 80b6daf commit bb2569d

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/google/go-cmp v0.5.8
1010
github.com/mattn/go-isatty v0.0.20
1111
github.com/rs/zerolog v1.31.0
12-
github.com/spf13/pflag v1.0.5
12+
github.com/spf13/pflag v1.0.10
1313
gopkg.in/yaml.v3 v3.0.1
1414
)
1515

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
2020
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
2121
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=
2222
github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
23-
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
24-
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
23+
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
24+
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
2525
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
2626
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
2727
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=

main.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package main
1717

1818
import (
19-
"errors"
2019
"fmt"
2120
"os"
2221
"path"
@@ -31,8 +30,6 @@ import (
3130
)
3231

3332
func main() {
34-
flag.CommandLine.Init(os.Args[0], flag.ContinueOnError)
35-
3633
c := &cmd.Config{}
3734
c.FromFlags(nil)
3835
logLevel := flag.CountP("verbose", "v", "Log more verbosely")
@@ -51,12 +48,7 @@ func main() {
5148
flag.PrintDefaults()
5249
}
5350

54-
if err := flag.CommandLine.Parse(os.Args[1:]); err != nil {
55-
if !errors.Is(err, flag.ErrHelp) {
56-
fmt.Fprintln(os.Stderr, err)
57-
}
58-
os.Exit(2)
59-
}
51+
flag.Parse()
6052

6153
if *version {
6254
fmt.Fprintln(os.Stdout, readVersion())

0 commit comments

Comments
 (0)