Browse Source

Fix: empty usage message with undefined flag

heimoshuiyu 3 years ago
parent
commit
5a96b37980
1 changed files with 3 additions and 0 deletions
  1. 3 0
      main/commands/base/execute.go

+ 3 - 0
main/commands/base/execute.go

@@ -14,6 +14,9 @@ import (
 
 // Execute excute the commands
 func Execute() {
+	flag.Usage = func() {
+		PrintUsage(os.Stderr, RootCommand)
+	}
 	flag.Parse()
 	args := flag.Args()
 	if len(args) < 1 {