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

Method MultiSelectWithSearch

internal/prompter/huh_prompter.go:115–122  ·  view source on GitHub ↗
(prompt, searchPrompt string, defaultValues, persistentValues []string, searchFunc func(string) MultiSelectSearchResult)

Source from the content-addressed store, hash-verified

113}
114
115func (p *huhPrompter) MultiSelectWithSearch(prompt, searchPrompt string, defaultValues, persistentValues []string, searchFunc func(string) MultiSelectSearchResult) ([]string, error) {
116 form, field := p.buildMultiSelectWithSearchForm(prompt, searchPrompt, defaultValues, persistentValues, searchFunc)
117 err := p.runForm(form)
118 if err != nil {
119 return nil, err
120 }
121 return field.selectedKeys(), nil
122}
123
124func (p *huhPrompter) buildInputForm(prompt, defaultValue string) (*huh.Form, *string) {
125 result := defaultValue

Callers

nothing calls this directly

Calls 3

runFormMethod · 0.95
selectedKeysMethod · 0.80

Tested by

no test coverage detected