Skip to content

Commit 413cf51

Browse files
author
BENJAMIN LOPEZ
committed
Fix double usage printing
1 parent 084ded5 commit 413cf51

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/notigo/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ func exitWithText(args ...interface{}) {
9292

9393
func exitWithTextIfError(text string, err error) {
9494
if err != nil {
95+
if flagsErr, ok := err.(*flags.Error); ok && flagsErr.Type == flags.ErrHelp {
96+
os.Exit(0)
97+
}
9598
exitWithText(text, err.Error())
9699
}
97100
}

0 commit comments

Comments
 (0)