Skip to content

Commit be986a3

Browse files
committed
Do not continue when -help flag was provided
Fixes printing command usage text twice
1 parent f9b2760 commit be986a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ func getFileNames() ([]string, error) {
133133
}
134134

135135
func main() {
136-
flags.Parse(os.Args[1:])
136+
if err := flags.Parse(os.Args[1:]); err == flag.ErrHelp {
137+
return
138+
}
137139

138140
if printVersion {
139141
fmt.Printf("gotags version %s\n", Version)

0 commit comments

Comments
 (0)