AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.09k stars 352 forks source link

Add support for custom input values to survey.Select #339

Open noerw opened 3 years ago

noerw commented 3 years ago

Sometimes, the provided Options are not enough, and custom user input is wanted.

The survey.Select + survey.MultiSelect prompts should offer this if an new option AllowCustomValues is true: This would add an implicit option "Other", that when selected follows up with a survey.Input prompt. Select would be done at this point, and MultiSelect would return to the options pager with the new entry added and selected.

AlecAivazis commented 3 years ago

Oh I like this! If you wanted to try to add it, I would love to support you however I can - feel free to reach out on the gophers slack!

fcarvalhido commented 2 years ago

By this, do you mean having dynamic values depending on the answers to previous questions?