bchao1 / bullet

🚅 Interactive prompts made simple. Build a prompt like stacking blocks.
https://pypi.org/project/bullet/
MIT License
3.55k stars 113 forks source link

Default values #25

Closed luckydonald closed 5 years ago

luckydonald commented 5 years ago

Hey there.

It would be really useful if a default value could be set:

result = YesNo(prompt="Please enter your user", default="root").launch()
Please enter your user [root]: _

When pressing enter and the input being empty (unchanged), that default would be the result.

This would also be great with Bullet and Check, there the default element(s) could be already ticked.

SylvainDe commented 5 years ago

I was reading the documentation then came here to report the same feature request :+1:

bchao1 commented 5 years ago

This feature is added! You can now define default in the launch() function.