Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Sep 25, 2023
1 parent ecdca8b commit 8713895
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ func registerValidArgsFunction(cmd *cobra.Command) {
func registerFlagCompletion(cmd *cobra.Command) {
cmd.LocalFlags().VisitAll(func(f *pflag.Flag) {
if !storage.hasFlag(cmd, f.Name) {
return
return // skip if not defined in carapace
}
if _, ok := cmd.GetFlagCompletionByName(f.Name); ok {
return // skip if already defined in cobra
}

err := cmd.RegisterFlagCompletionFunc(f.Name, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
Expand Down

0 comments on commit 8713895

Please sign in to comment.