From c719dc934fe0a4059b55dd349900d973d2fa9d10 Mon Sep 17 00:00:00 2001 From: bth Date: Mon, 19 Jan 2026 11:22:34 -0800 Subject: [PATCH] tag : skip value arg in parseArgs --- tag/tag.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tag/tag.go b/tag/tag.go index c24774d..f3bd616 100644 --- a/tag/tag.go +++ b/tag/tag.go @@ -24,16 +24,17 @@ func initOpts() options { func parseArgs(args []string) options { opts := initOpts() - for i, arg := range args { + for i := 0; i < len(args); i++ { + arg := args[i] switch { case i == 0 && !flags.HasDashPrefix(arg): opts.Query.Val = arg case arg == opts.Invert.Long || arg == opts.Invert.Short: opts.Invert.Val = true case arg == opts.Date.Long || arg == opts.Date.Short: - // TODO: should we use reflection here for a general Valid(arg, opts.Field)? flags.ValidValueOrExit(args, i) opts.Date.Val = args[i+1] + i++ case arg == opts.Help.Long || arg == opts.Help.Short: flags.Help("tag", opts) default: