1
0
Fork 0
mirror of https://github.com/spf13/cobra synced 2025-04-07 15:29:16 +00:00

Add AllowCustomFlagCompletions field to Command struct for enhanced flag completion handling

This commit is contained in:
Francis Nickels 2025-03-03 14:18:10 -08:00
parent 1995054b00
commit 3736e5e7b8

View file

@ -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