From 519d6cf263cf24b5649c5e473034f082d33371db Mon Sep 17 00:00:00 2001 From: bth Date: Sun, 18 Jan 2026 10:21:01 -0800 Subject: [PATCH] next : keep tags as single flags.Arg : handle comma Split later, ParseArgs does just that --- next/next.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/next/next.go b/next/next.go index 52f109c..1e27154 100644 --- a/next/next.go +++ b/next/next.go @@ -3,20 +3,19 @@ package next import ( "fmt" "os" - "strings" "github.com/brtholomy/um/go/flags" ) type options struct { descriptor flags.Arg - tags []flags.Arg + tags flags.Arg } func InitOpts() options { return options{ flags.Arg{"", "midfix file descriptor"}, - []flags.Arg{}, + flags.Arg{"", "tags to add to new file"}, } } @@ -25,11 +24,9 @@ func ParseArgs(args []string) options { for i, arg := range args { switch { case i == 0 && !flags.HasDashPrefix(arg): - opts.descriptor.Val = args[0] + opts.descriptor.Val = arg case i == 1 && !flags.HasDashPrefix(arg): - for _, t := range strings.Split(args[1], ",") { - opts.tags = append(opts.tags, flags.Arg{t, "tag"}) - } + opts.tags.Val = arg case i >= 2: fmt.Println("um next : too many args") os.Exit(1)