flags.ValidValueOrExit and os.Exit on Help

This commit is contained in:
bth 2026-01-18 20:17:40 -08:00
commit c19b11e115
5 changed files with 32 additions and 24 deletions

View file

@ -2,7 +2,6 @@ package next
import (
"fmt"
"os"
"github.com/brtholomy/um/go/flags"
)
@ -31,15 +30,15 @@ func parseArgs(args []string) options {
opts.Tags.Val = arg
case i >= 2:
fmt.Println("um next : too many args")
os.Exit(1)
flags.Help("next", opts)
case arg == opts.Help.Long || arg == opts.Help.Short:
flags.Help("next", opts)
return opts
}
}
return opts
}
func Next(args []string) {
_ = parseArgs(args)
opts := parseArgs(args)
fmt.Println(opts)
}