From f59f7ace1483a2ecaca10a7581c458d614d5dfb6 Mon Sep 17 00:00:00 2001 From: Francis Nickels <fnickels@riotgames.com> Date: Mon, 3 Mar 2025 14:39:19 -0800 Subject: [PATCH] Refactor HasCustomFlagCompletion method documentation for clarity on custom flag completions --- command.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/command.go b/command.go index 470c7517..45b47c95 100644 --- a/command.go +++ b/command.go @@ -1607,10 +1607,11 @@ func (c *Command) HasSubCommands() bool { return len(c.commands) > 0 } -// IsAvailableCommand determines if a command is available as a non-help command -// (this includes all non deprecated/hidden commands). +// HasCustomFlagCompletion determines if a command has a defined +// 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 { - if c.ValidArgsFunction == nil { return false }