From 697805765e3b2c4bc4228120876acdd20271721a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 10 Jul 2025 08:20:16 +0530 Subject: [PATCH] ... --- tools/cli/completion-main.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/cli/completion-main.go b/tools/cli/completion-main.go index dd72b306c..fbb829a77 100644 --- a/tools/cli/completion-main.go +++ b/tools/cli/completion-main.go @@ -49,10 +49,7 @@ func GenerateCompletions(args []string) error { output_type = args[0] args = args[1:] } - n := len(args) - if n < 1 { - n = 1 - } + n := max(1, len(args)) if output_type == "setup" { if len(args) == 0 { return fmt.Errorf("The shell must be specified")