MCPcopy Index your code
hub / github.com/coder/coder / newMultiSelect

Function newMultiSelect

cli/cliui/select_test.go:198–216  ·  view source on GitHub ↗
(pty *ptytest.PTY, items []string, custom bool)

Source from the content-addressed store, hash-verified

196}
197
198func newMultiSelect(pty *ptytest.PTY, items []string, custom bool) ([]string, error) {
199 var values []string
200 cmd := &serpent.Command{
201 Handler: func(inv *serpent.Invocation) error {
202 selectedItems, err := cliui.MultiSelect(inv, cliui.MultiSelectOptions{
203 Options: items,
204 Defaults: items,
205 EnableCustomInput: custom,
206 })
207 if err == nil {
208 values = selectedItems
209 }
210 return err
211 },
212 }
213 inv := cmd.Invoke()
214 pty.Attach(inv)
215 return values, inv.Run()
216}

Callers 1

TestMultiSelectFunction · 0.85

Calls 4

MultiSelectFunction · 0.92
AttachMethod · 0.65
RunMethod · 0.65
InvokeMethod · 0.45

Tested by

no test coverage detected