From 3736e5e7b8b78f4408bc35d44065f4da6433d6cc Mon Sep 17 00:00:00 2001 From: Francis Nickels <fnickels@riotgames.com> Date: Mon, 3 Mar 2025 14:18:10 -0800 Subject: [PATCH] Add AllowCustomFlagCompletions field to Command struct for enhanced flag completion handling --- command.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/command.go b/command.go index 140fbfdf..ec43d7c5 100644 --- a/command.go +++ b/command.go @@ -257,6 +257,11 @@ type Command struct { // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. // Must be > 0. SuggestionsMinimumDistance int + + // When performing commandline completions specific to handling flags only, override + // Cobra's default behavior and allow ValidArgsFunction to be used if it exists, otherwise + // use the default behavior + AllowCustomFlagCompletions bool } // Context returns underlying command context. If command was executed