From f93dbcc1ec4d1169fea2e0b74ebf69bfba91687a Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Sun, 24 Nov 2024 22:35:42 +0100 Subject: [PATCH] use `cmd.Name` when generating completion script --- 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(