|
1 | 1 | package cliui
|
2 | 2 |
|
3 | 3 | import (
|
4 |
| - "flag" |
5 | 4 | "fmt"
|
6 | 5 | "strings"
|
7 | 6 |
|
@@ -66,16 +65,6 @@ func RichSelect(inv *serpent.Invocation, richOptions RichSelectOptions) (*coders
|
66 | 65 |
|
67 | 66 | // Select displays a list of user options.
|
68 | 67 | func Select(inv *serpent.Invocation, opts SelectOptions) (string, error) {
|
69 |
| - // TODO: Check if this is still true for Bubbletea. |
70 |
| - // The survey library used *always* fails when testing on Windows, |
71 |
| - // as it requires a live TTY (can't be a conpty). We should fork |
72 |
| - // this library to add a dummy fallback, that simply reads/writes |
73 |
| - // to the IO provided. See: |
74 |
| - // https://github.com/AlecAivazis/survey/blob/master/terminal/runereader_windows.go#L94 |
75 |
| - if flag.Lookup("test.v") != nil { |
76 |
| - return opts.Options[0], nil |
77 |
| - } |
78 |
| - |
79 | 68 | initialModel := selectModel{
|
80 | 69 | search: textinput.New(),
|
81 | 70 | hideSearch: opts.HideSearch,
|
@@ -249,11 +238,6 @@ type MultiSelectOptions struct {
|
249 | 238 | }
|
250 | 239 |
|
251 | 240 | func MultiSelect(inv *serpent.Invocation, opts MultiSelectOptions) ([]string, error) {
|
252 |
| - // Similar hack is applied to Select() |
253 |
| - if flag.Lookup("test.v") != nil { |
254 |
| - return opts.Defaults, nil |
255 |
| - } |
256 |
| - |
257 | 241 | options := make([]*multiSelectOption, len(opts.Options))
|
258 | 242 | for i, option := range opts.Options {
|
259 | 243 | chosen := false
|
|
0 commit comments