1
0
Fork 0
mirror of https://github.com/spf13/cobra synced 2025-04-06 23:09:12 +00:00

Refactor HasCustomFlagCompletion method documentation for clarity on custom flag completions

This commit is contained in:
Francis Nickels 2025-03-03 14:39:19 -08:00
parent 39a6bbba47
commit f59f7ace14

View file

@ -1607,10 +1607,11 @@ func (c *Command) HasSubCommands() bool {
return len(c.commands) > 0 return len(c.commands) > 0
} }
// IsAvailableCommand determines if a command is available as a non-help command // HasCustomFlagCompletion determines if a command has a defined
// (this includes all non deprecated/hidden commands). // ValidArgsFunction, if it does, then it returns the value of
// the AllowCustomFlagCompletions field indicating if the function
// should be used for handling custom flag completions.
func (c *Command) HasCustomFlagCompletion() bool { func (c *Command) HasCustomFlagCompletion() bool {
if c.ValidArgsFunction == nil { if c.ValidArgsFunction == nil {
return false return false
} }