runMultiSelect runs a bubbletea multi-select picker and returns the selected labels. Returns nil if the user aborted.
(title string, items []multiSelectItem)
| 228 | // runMultiSelect runs a bubbletea multi-select picker and returns the |
| 229 | // selected labels. Returns nil if the user aborted. |
| 230 | func runMultiSelect(title string, items []multiSelectItem) ([]string, error) { |
| 231 | model := newMultiSelectModel(title, items) |
| 232 | p := tea.NewProgram(model) |
| 233 | final, err := p.Run() |
| 234 | if err != nil { |
| 235 | return nil, err |
| 236 | } |
| 237 | result := final.(multiSelectModel) |
| 238 | if result.aborted { |
| 239 | return nil, nil |
| 240 | } |
| 241 | return result.selectedLabels(), nil |
| 242 | } |
no test coverage detected