From 0ff9e6d9a376e37a5361a24adb2ecd23b30cb634 Mon Sep 17 00:00:00 2001 From: bth Date: Mon, 19 Jan 2026 18:25:06 -0800 Subject: [PATCH] next : consistent default case handling across subcmds --- next/next.go | 6 +++--- sort/sort.go | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/next/next.go b/next/next.go index 011d60c..886b101 100644 --- a/next/next.go +++ b/next/next.go @@ -32,11 +32,11 @@ func parseArgs(args []string) options { opts.Descriptor.Val = arg case i == 1 && !flags.HasDashPrefix(arg): opts.Tags.Val = arg - case i >= 2: - log.Printf("um next: too many args: %s", args) - flags.Help("next", opts) case arg == opts.Help.Long || arg == opts.Help.Short: flags.Help("next", opts) + default: + log.Printf("um next: invalid argument: %s", arg) + flags.Help("next", opts) } } return opts diff --git a/sort/sort.go b/sort/sort.go index f6b8a25..d970a8c 100644 --- a/sort/sort.go +++ b/sort/sort.go @@ -29,7 +29,6 @@ func initOpts() options { func parseArgs(args []string) options { opts := initOpts() - for i := 0; i < len(args); i++ { arg := args[i] switch {