MCPcopy Create free account
hub / github.com/cli/cli / runSelect

Function runSelect

pkg/cmd/preview/prompter/prompter.go:133–142  ·  view source on GitHub ↗
(p prompter.Prompter, io *iostreams.IOStreams)

Source from the content-addressed store, hash-verified

131}
132
133func runSelect(p prompter.Prompter, io *iostreams.IOStreams) error {
134 fmt.Fprintln(io.Out, "Demonstrating Single Select")
135 cuisines := []string{"Italian", "Greek", "Indian", "Japanese", "American"}
136 favorite, err := p.Select("Favorite cuisine?", "Italian", cuisines)
137 if err != nil {
138 return err
139 }
140 fmt.Fprintf(io.Out, "Favorite cuisine: %s\n", cuisines[favorite])
141 return nil
142}
143
144func runMultiSelect(p prompter.Prompter, io *iostreams.IOStreams) error {
145 fmt.Fprintln(io.Out, "Demonstrating Multi Select")

Callers

nothing calls this directly

Calls 1

SelectMethod · 0.65

Tested by

no test coverage detected