From 6d4e81c8413cc64ca2cb556a78254506e0df861e Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Mon, 25 Nov 2024 14:30:10 +0100 Subject: [PATCH] use `cmd.Name` when generating completion script (#2012) --- command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command.go b/command.go index 3b7c97ca97..e80432ade2 100644 --- a/command.go +++ b/command.go @@ -257,7 +257,7 @@ func (cmd *Command) setupDefaults(osArgs []string) { } if cmd.EnableShellCompletion || cmd.Root().shellCompletion { - completionCommand := buildCompletionCommand(osArgs[0]) + completionCommand := buildCompletionCommand(cmd.Name) if cmd.ShellCompletionCommandName != "" { tracef(