Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

Commit e47352f

Browse files
authored
Fix README formatting for select descriptions (#426)
1 parent c2be27f commit e47352f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,11 @@ prompt := &survey.MultiSelect{..., PageSize: 10}
191191

192192
// or as an option to Ask or AskOne
193193
survey.AskOne(prompt, &days, survey.WithPageSize(10))
194+
```
195+
196+
#### Select options description
194197

195-
#### Select option's description
198+
The optional description text can be used to add extra information to each option listed in the select prompt:
196199

197200
```golang
198201
color := ""
@@ -207,6 +210,9 @@ prompt := &survey.Select{
207210
},
208211
}
209212
survey.AskOne(prompt, &color)
213+
214+
// Assuming that the user chose "red - My favorite color":
215+
fmt.Println(color) //=> "red"
210216
```
211217

212218
### MultiSelect

0 commit comments

Comments
 (0)