瀏覽代碼

Fix: empty usage message with undefined flag

heimoshuiyu 3 年之前
父節點
當前提交
5a96b37980
共有 1 個文件被更改,包括 3 次插入0 次删除
  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 {