From eeca8112eb7b796796a1a59c8e3aad537b1f6812 Mon Sep 17 00:00:00 2001
From: Francis Nickels <fnickels@riotgames.com>
Date: Mon, 3 Mar 2025 14:41:38 -0800
Subject: [PATCH] Update flagCompletion logic to respect
 HasCustomFlagCompletion method

---
 completions.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/completions.go b/completions.go
index a1752f76..b9561f9d 100644
--- a/completions.go
+++ b/completions.go
@@ -358,7 +358,7 @@ func (c *Command) getCompletions(args []string) (*Command, []Completion, ShellCo
 	// This works by counting the arguments. Normally -- is not counted as arg but
 	// if -- was already set or interspersed is false and there is already one arg then
 	// the extra added -- is counted as arg.
-	flagCompletion := true
+	flagCompletion := !finalCmd.HasCustomFlagCompletion()
 	_ = finalCmd.ParseFlags(append(finalArgs, "--"))
 	newArgCount := finalCmd.Flags().NArg()