(pty *ptytest.PTY, items []string, custom bool)
| 196 | } |
| 197 | |
| 198 | func 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 | } |
no test coverage detected