Skip to content

Commit 7cf35d1

Browse files
chore: make SelectedOptions private
1 parent 360fb95 commit 7cf35d1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

cli/cliui/select.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,7 @@ func MultiSelect(inv *serpent.Invocation, opts MultiSelectOptions) ([]string, er
281281
return values, Canceled
282282
}
283283

284-
for _, option := range m.options {
285-
if option.chosen {
286-
values = append(values, option.option)
287-
}
288-
}
284+
values = m.selectedOptions()
289285
}
290286
return values, err
291287
}
@@ -393,15 +389,15 @@ func (m multiSelectModel) View() string {
393389
s += fmt.Sprintf("%s%s %s\n", cursor, chosen, o)
394390
}
395391
} else {
396-
selected := pretty.Sprint(DefaultStyles.Keyword, strings.Join(m.SelectedOptions(), ", "))
392+
selected := pretty.Sprint(DefaultStyles.Keyword, strings.Join(m.selectedOptions(), ", "))
397393

398394
s += fmt.Sprintf("%s %s\n", msg, selected)
399395
}
400396

401397
return s
402398
}
403399

404-
func (m multiSelectModel) SelectedOptions() []string {
400+
func (m multiSelectModel) selectedOptions() []string {
405401
selected := []string{}
406402
for _, o := range m.options {
407403
if o.chosen {

0 commit comments

Comments
 (0)