mirror of
https://github.com/spf13/cobra
synced 2025-04-01 20:39:12 +00:00
Update flagCompletion logic to respect HasCustomFlagCompletion method
This commit is contained in:
parent
f59f7ace14
commit
eeca8112eb
1 changed files with 1 additions and 1 deletions
|
@ -358,7 +358,7 @@ func (c *Command) getCompletions(args []string) (*Command, []Completion, ShellCo
|
|||
// This works by counting the arguments. Normally -- is not counted as arg but
|
||||
// if -- was already set or interspersed is false and there is already one arg then
|
||||
// the extra added -- is counted as arg.
|
||||
flagCompletion := true
|
||||
flagCompletion := !finalCmd.HasCustomFlagCompletion()
|
||||
_ = finalCmd.ParseFlags(append(finalArgs, "--"))
|
||||
newArgCount := finalCmd.Flags().NArg()
|
||||
|
||||
|
|
Loading…
Reference in a new issue