MCPcopy Index your code
hub / github.com/cli/cli / selectedKeys

Method selectedKeys

internal/prompter/multi_select_with_search.go:187–204  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

185}
186
187func (m *multiSelectSearchField) selectedKeys() []string {
188 keys := make([]string, 0)
189 // Maintain order: defaults first, then any added during this session.
190 seen := make(map[string]bool)
191 for _, k := range m.defaultValues {
192 if m.selected[k] && !seen[k] {
193 keys = append(keys, k)
194 seen[k] = true
195 }
196 }
197 for _, o := range m.options {
198 if m.selected[o.value] && !seen[o.value] {
199 keys = append(keys, o.value)
200 seen[o.value] = true
201 }
202 }
203 return keys
204}
205
206func (m *multiSelectSearchField) label(key string) string {
207 if l, ok := m.optionLabels[key]; ok && l != "" {

Calls

no outgoing calls