Fix: empty usage message with undefined flag

This commit is contained in:
heimoshuiyu 2022-10-20 19:45:12 +08:00 committed by Xiaokang Wang (Shelikhoo)
parent f67e46cb1b
commit 5a96b37980
1 changed files with 3 additions and 0 deletions

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 {