Browse Source

Only print help when called without arguments

Fixes #401
Filippo Valsorda 2 years ago
parent
commit
d7ab78de71
1 changed files with 4 additions and 0 deletions
  1. 4 0
      main.go

+ 4 - 0
main.go

@@ -85,6 +85,10 @@ const advancedUsage = `Advanced options:
 var Version string
 
 func main() {
+	if len(os.Args) == 1 {
+		fmt.Print(shortUsage)
+		return
+	}
 	log.SetFlags(0)
 	var (
 		installFlag   = flag.Bool("install", false, "")