From 9f26d1cf299205ce5a9f993eb9fd77658912c028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=B9=BF?= Date: Fri, 15 Nov 2024 15:10:05 +0800 Subject: [PATCH] remove --help --- flag.go | 8 ++++---- test/main.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flag.go b/flag.go index 03e8ed6..821e7d2 100644 --- a/flag.go +++ b/flag.go @@ -139,10 +139,10 @@ func NewFVSet(v interface{}) (*FVSet, error) { } } } - flags.BoolFunc("help", "Show help", func(s string) error { - flags.Usage() - return nil - }) + // flags.BoolFunc("help", "Show help", func(s string) error { + // flags.Usage() + // return nil + // }) return &FVSet{ Name: name, Value: &v, diff --git a/test/main.go b/test/main.go index 81cea16..fdb6aae 100644 --- a/test/main.go +++ b/test/main.go @@ -15,6 +15,6 @@ func main() { } sargs := &targs{} v, _ := command.NewFVSet(sargs) - v.Parse(os.Args[1:]) - fmt.Println(sargs) + err := v.Parse(os.Args[1:]) + fmt.Println(sargs, err) }