Fix: empty usage message with undefined flag

This commit is contained in:
heimoshuiyu
2023-11-19 00:00:18 +00:00
committed by Xiaokang Wang (Shelikhoo)
parent f67e46cb1b
commit 5a96b37980
+3
View File
@@ -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 {