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

Function newRichSelect

cli/cliui/select_test.go:66–80  ·  view source on GitHub ↗
(ptty *ptytest.PTY, opts cliui.RichSelectOptions)

Source from the content-addressed store, hash-verified

64}
65
66func newRichSelect(ptty *ptytest.PTY, opts cliui.RichSelectOptions) (string, error) {
67 value := ""
68 cmd := &serpent.Command{
69 Handler: func(inv *serpent.Invocation) error {
70 richOption, err := cliui.RichSelect(inv, opts)
71 if err == nil {
72 value = richOption.Value
73 }
74 return err
75 },
76 }
77 inv := cmd.Invoke()
78 ptty.Attach(inv)
79 return value, inv.Run()
80}
81
82func TestRichMultiSelect(t *testing.T) {
83 t.Parallel()

Callers 1

TestRichSelectFunction · 0.85

Calls 4

RichSelectFunction · 0.92
AttachMethod · 0.65
RunMethod · 0.65
InvokeMethod · 0.45

Tested by

no test coverage detected