diff --git a/command.go b/command.go index ec43d7c5..470c7517 100644 --- a/command.go +++ b/command.go @@ -1607,6 +1607,17 @@ 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). +func (c *Command) HasCustomFlagCompletion() bool { + + if c.ValidArgsFunction == nil { + return false + } + + return c.AllowCustomFlagCompletions +} + // IsAvailableCommand determines if a command is available as a non-help command // (this includes all non deprecated/hidden commands). func (c *Command) IsAvailableCommand() bool {