Skip to content
Myr

fix(completions): Complete map flags multiple times (#2174)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Gabe Cook · committed by GitHub · parent 371ae25 · Browse files · 1 file+3 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−2 removed

  • other:+3 added−2 removed

1 file+3 added−2 removed

modified:completions.go+3 added-2 removed
399 unmodified lines
400 if len(completions) == 0 {401 doCompleteFlags := func(flag *pflag.Flag) {402 if !flag.Changed ||403 strings.Contains(flag.Value.Type(), "Slice") ||404 strings.Contains(flag.Value.Type(), "Array") {405 // If the flag is not already present, or if it can be specified multiple times (Array or Slice)404 strings.Contains(flag.Value.Type(), "Array") ||405 strings.HasPrefix(flag.Value.Type(), "stringTo") {406 // If the flag is not already present, or if it can be specified multiple times (Array, Slice, or stringTo)407 // we suggest it as a completion408 completions = append(completions, getFlagNameCompletions(flag, toComplete)...)409 }410 }
530 unmodified lines