From 411a8aff85dd161dcf0502b8cd43f634f534aad3 Mon Sep 17 00:00:00 2001
From: Gabe Cook <gabe565@gmail.com>
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 c0c08b05..8fccdaf2 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.HasPrefix(flag.Value.Type(), "stringTo") {
+					// If the flag is not already present, or if it can be specified multiple times (Array, Slice, or stringTo)
 					// we suggest it as a completion
 					completions = append(completions, getFlagNameCompletions(flag, toComplete)...)
 				}