Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add show question example #166

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

wtrocki
Copy link

@wtrocki wtrocki commented Nov 26, 2020

Resolving numerous issues like:

#81

Putting my code with low hopes of getting this merged, but if you find this useful +1
I can improve it/add to examples etc. It feels like boolean prompt should be supported out of the box.

@CLAassistant
Copy link

CLAassistant commented Nov 26, 2020

CLA assistant check
All committers have signed the CLA.

ShowQuestion.go Outdated Show resolved Hide resolved
ShowQuestion.go Outdated Show resolved Hide resolved
"github.com/manifoldco/promptui"
)

func ShowQuestion(message string) bool {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I extended this with
func ShowQuestion(message string, defaultValueFlag bool) bool
then use that flag to set Default to either y or n so I can have different question types.

@jaredkotoff
Copy link

Thanks for writing this. I also agree that it's kind of weird that this isn't a built-in feature.
Also for what it's worth, I was having some issues with this and race conditions on v0.8.0. I rolled back to v0.3.2 and this works prefectly

@wtrocki
Copy link
Author

wtrocki commented Apr 27, 2021

I will look into this today. Sorry for low quality contribution. I did not get much hope of merging

@wtrocki
Copy link
Author

wtrocki commented Apr 27, 2021

@jaredkotoff Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants