Browse Source

Don't print help twice

Jakob Borg 12 years ago
parent
commit
fc2b557ae6
1 changed files with 5 additions and 0 deletions
  1. 5 0
      main.go

+ 5 - 0
main.go

@@ -75,6 +75,11 @@ var (
 func main() {
 	_, err := flags.Parse(&opts)
 	if err != nil {
+		if err, ok := err.(*flags.Error); ok {
+			if err.Type == flags.ErrHelp {
+				os.Exit(0)
+			}
+		}
 		fatalln(err)
 	}