From 31c22c8d43ddf13d12c91f98afab0bac489651d6 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Sat, 27 Jul 2024 02:29:53 -0500 Subject: [PATCH] fix(completions): Complete map flags multiple times --- completions.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/completions.go b/completions.go index c0c08b057..620de698f 100644 --- a/completions.go +++ b/completions.go @@ -401,8 +401,9 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi doCompleteFlags := func(flag *pflag.Flag) { if !flag.Changed || strings.Contains(flag.Value.Type(), "Slice") || - strings.Contains(flag.Value.Type(), "Array") { - // If the flag is not already present, or if it can be specified multiple times (Array or Slice) + strings.Contains(flag.Value.Type(), "Array") || + strings.Contains(flag.Value.Type(), "To") { + // If the flag is not already present, or if it can be specified multiple times (Array, Slice, or To) // we suggest it as a completion completions = append(completions, getFlagNameCompletions(flag, toComplete)...) }