File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -70,17 +70,22 @@ type RichSelectOptions struct {
70
70
// RichSelect displays a list of user options including name and description.
71
71
func RichSelect (inv * clibase.Invocation , richOptions RichSelectOptions ) (* codersdk.TemplateVersionParameterOption , error ) {
72
72
opts := make ([]string , len (richOptions .Options ))
73
+ var defaultOpt string
73
74
for i , option := range richOptions .Options {
74
75
line := option .Name
75
76
if len (option .Description ) > 0 {
76
77
line += ": " + option .Description
77
78
}
78
79
opts [i ] = line
80
+
81
+ if option .Value == richOptions .Default {
82
+ defaultOpt = line
83
+ }
79
84
}
80
85
81
86
selected , err := Select (inv , SelectOptions {
82
87
Options : opts ,
83
- Default : richOptions . Default ,
88
+ Default : defaultOpt ,
84
89
Size : richOptions .Size ,
85
90
HideSearch : richOptions .HideSearch ,
86
91
})
You can’t perform that action at this time.
0 commit comments