mirror of
https://github.com/spf13/cobra
synced 2025-04-01 20:39:12 +00:00
Merge 4b1dae3acd
into ceb39aba25
This commit is contained in:
commit
eaca1fe3bb
1 changed files with 2 additions and 0 deletions
|
@ -360,6 +360,8 @@ func (c *Command) getCompletions(args []string) (*Command, []Completion, ShellCo
|
|||
// the extra added -- is counted as arg.
|
||||
flagCompletion := true
|
||||
_ = finalCmd.ParseFlags(append(finalArgs, "--"))
|
||||
// Reset ArgsLenAtDash.
|
||||
finalCmd.Flags().Init(finalCmd.Flags().Name(), pflag.ContinueOnError)
|
||||
newArgCount := finalCmd.Flags().NArg()
|
||||
|
||||
// Parse the flags early so we can check if required flags are set
|
||||
|
|
Loading…
Reference in a new issue