Skip to content

Commit

Permalink
FlagParsingDisabled: fix positional completion
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Dec 19, 2023
1 parent 1ac5077 commit 83548e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion defaultActions.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,11 @@ func ActionCobra(f func(cmd *cobra.Command, args []string, toComplete string) ([
LOG.Print("cmd is nil [ActionCobra]")
c.cmd = &cobra.Command{Use: "_carapace_actioncobra", Hidden: true, Deprecated: "dummy command for ActionCobra"}
}
values, directive := f(c.cmd, c.cmd.Flags().Args(), c.Value)

if !c.cmd.DisableFlagParsing {
c.Args = c.cmd.Flags().Args()
}
values, directive := f(c.cmd, c.Args, c.Value)
return compDirective(directive).ToA(values...)
})
}

0 comments on commit 83548e1

Please sign in to comment.