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

Method MultiSelectWithSearch

internal/prompter/prompter.go:32–32  ·  view source on GitHub ↗

MultiSelectWithSearch is MultiSelect with an added search option to the list, prompting the user for text input to filter the options via the searchFunc. Items selected in the search are persisted in the list after subsequent searches. Items passed in persistentOptions are always shown in the list,

(prompt, searchPrompt string, defaults []string, persistentOptions []string, searchFunc func(string) MultiSelectSearchResult)

Source from the content-addressed store, hash-verified

30 // The searchFunc has the signature: func(query string) MultiSelectSearchResult.
31 // In the returned MultiSelectSearchResult, Keys are the values eventually returned by MultiSelectWithSearch and Labels are what is shown to the user in the prompt.
32 MultiSelectWithSearch(prompt, searchPrompt string, defaults []string, persistentOptions []string, searchFunc func(string) MultiSelectSearchResult) ([]string, error)
33 // Input prompts the user to enter a string value.
34 Input(prompt string, defaultValue string) (string, error)
35 // Password prompts the user to enter a password.

Callers 1

TestAccessiblePrompterFunction · 0.65

Implementers 4

PrompterMockinternal/prompter/prompter_mock.go
huhPrompterinternal/prompter/huh_prompter.go
accessiblePrompterinternal/prompter/prompter.go
surveyPrompterinternal/prompter/prompter.go

Calls

no outgoing calls

Tested by 1

TestAccessiblePrompterFunction · 0.52