AlecAivazis / survey

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

Added missing AskOpts #216

Closed AlecAivazis closed 5 years ago

AlecAivazis commented 5 years ago

This PR continues the work in #201 and adds the remaining AskOpts:

This has to go in after #214 since it relies on the PromptConfig which was introduced it that PR.

AlecAivazis commented 5 years ago

@coryb there is now parity across the methods in the Prompt interface. Not sure why I wanted to avoid another file in the root of the project when there are already so many...

AlecAivazis commented 5 years ago

I thought a bit more about this API and i think one of two things needs to happen. Either I should remove WithHelpInput or HelpInput should be removed from the IconSet struct. It's not clear from the API what would happen if you passed both WithHelpInput and a WithIconSet that modified the icon since they modify the same field in the icon set.

Any preference @coryb? Keeping it in the IconSet has a smaller API surface since its kind of tucked away. But it's also not really an "icon" like the others since it's input and would never include any kind of color configuration regardless of how #141 shakes out.

EDIT: I decided to go with removing HelpInput from the IconSet. I think this is good to go now.