From 40cc8ba8a9082953002a5b9ccf6a7faa1ca36f3c Mon Sep 17 00:00:00 2001 From: yuanzhao <2206582181@qq.com> Date: Fri, 16 Aug 2024 16:31:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E9=A1=B9=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Console.go | 2 +- examples/main.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Console.go b/Console.go index 482d87c..46453ce 100644 --- a/Console.go +++ b/Console.go @@ -237,7 +237,7 @@ func (i *Input) ParsedOptions(Config Argument, args []string) { // 支持多个默认值 for _, kv2 := range Config.Option { if kv.Name == kv2.Name { - i.Option[kv.Name] = append(i.Option[kv.Name], kv.Default) + i.Option[kv.Name] = append(i.Option[kv.Name], kv2.Default) } } } diff --git a/examples/main.go b/examples/main.go index 235820e..54199e9 100644 --- a/examples/main.go +++ b/examples/main.go @@ -11,7 +11,7 @@ func main() { app.AddBaseOption(command.ArgParam{ Name: "TEST", - Description: "fffffffffffffffffffffffff", + Description: "显示帮助信息", Default: "false", Call: nil, }) @@ -55,7 +55,8 @@ func (Hello) Configure() command.Configure { }, // 可选的参数,不输入也能执行 Option: []command.ArgParam{ - {Name: "age", Description: "年龄选项参数"}, + {Name: "age", Description: "年龄选项参数", Default: "18"}, + {Name: "age", Description: "年龄选项参数", Default: "24"}, }, }, }