@@ -21,7 +21,7 @@ func init() {
21
21
{{- .CurrentOpt.Value}}
22
22
{{- color "reset"}}
23
23
{{end}}
24
- {{- if .Message }}{{- color "default+hb"}}{{ .Message }}{{ .FilterMessage }}{{color "reset"}}{{ end }}
24
+
25
25
{{- if not .ShowAnswer }}
26
26
{{- if .Config.Icons.Help.Text }}
27
27
{{- if .FilterMessage }}{{ "Search:" }}{{ .FilterMessage }}
@@ -44,20 +44,18 @@ func init() {
44
44
{{- " "}}{{- .CurrentOpt.Value}}
45
45
{{end}}
46
46
{{- if .ShowHelp }}{{- color .Config.Icons.Help.Format }}{{ .Config.Icons.Help.Text }} {{ .Help }}{{color "reset"}}{{"\n"}}{{end}}
47
- {{- if .Message }}{{- color "default+hb"}}{{ .Message }}{{ .FilterMessage }}{{color "reset"}}{{ end }}
48
47
{{- if not .ShowAnswer }}
49
48
{{- "\n"}}
50
49
{{- range $ix, $option := .PageEntries}}
51
50
{{- template "option" $.IterateOption $ix $option}}
52
51
{{- end}}
53
- {{- end }}`
52
+ {{- end}}`
54
53
}
55
54
56
55
type SelectOptions struct {
57
56
Options []string
58
57
// Default will be highlighted first if it's a valid option.
59
58
Default string
60
- Message string
61
59
Size int
62
60
HideSearch bool
63
61
}
@@ -124,7 +122,6 @@ func Select(inv *serpent.Invocation, opts SelectOptions) (string, error) {
124
122
Options : opts .Options ,
125
123
Default : defaultOption ,
126
124
PageSize : opts .Size ,
127
- Message : opts .Message ,
128
125
}, & value , survey .WithIcons (func (is * survey.IconSet ) {
129
126
is .Help .Text = "Type to search"
130
127
if opts .HideSearch {
@@ -141,22 +138,15 @@ func Select(inv *serpent.Invocation, opts SelectOptions) (string, error) {
141
138
return value , err
142
139
}
143
140
144
- type MultiSelectOptions struct {
145
- Message string
146
- Options []string
147
- Defaults []string
148
- }
149
-
150
- func MultiSelect (inv * serpent.Invocation , opts MultiSelectOptions ) ([]string , error ) {
141
+ func MultiSelect (inv * serpent.Invocation , items []string ) ([]string , error ) {
151
142
// Similar hack is applied to Select()
152
143
if flag .Lookup ("test.v" ) != nil {
153
- return opts . Defaults , nil
144
+ return items , nil
154
145
}
155
146
156
147
prompt := & survey.MultiSelect {
157
- Message : opts .Message ,
158
- Options : opts .Options ,
159
- Default : opts .Defaults ,
148
+ Options : items ,
149
+ Default : items ,
160
150
}
161
151
162
152
var values []string
0 commit comments