MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / SelectOptions

Function SelectOptions

pkg/question/selectors/selectors.go:34–40  ·  view source on GitHub ↗
(ask question.Asker, questionText string, itemsCallback func() []*SelectOption[T])

Source from the content-addressed store, hash-verified

32}
33
34func SelectOptions[T any](ask question.Asker, questionText string, itemsCallback func() []*SelectOption[T]) (*SelectOption[T], error) {
35 items := itemsCallback()
36 callback := func() ([]*SelectOption[T], error) {
37 return items, nil
38 }
39 return Select(ask, questionText, callback, func(option *SelectOption[T]) string { return option.Display })
40}
41
42func Select[T any](ask question.Asker, questionText string, itemsCallback func() ([]T, error), getKey func(item T) string) (T, error) {
43 items, err := itemsCallback()

Callers 8

PromptForDotNetConfigFunction · 0.92
PromptMissingFunction · 0.92
PromptMissingFunction · 0.92
PromptForConfigAsCodeFunction · 0.92
PromptMissingV1Function · 0.92
PromptMissingFunction · 0.92
PromptForEnvironmentV1Function · 0.92
PromptValueFunction · 0.92

Calls 1

SelectFunction · 0.70

Tested by

no test coverage detected