Added list of choices to termui prompt for user data if the data requested is a Choice.
Before adoption: this commit came in with the history the project adopted, so no landing records it.
It was odd that the user had to give incorrect input in order to be presented with the list of available options, for example: ``` Group by: something Error: invalid choice: something. (choose from none, day, week, month) ``` In the above example the user is asked to give the program some interval to group by but offers no help as to what the valid inputs are until the user has incorrectly entered 'something'. With the modifications included in this commit the prompt would look as follows: ``` Group by (none, day, week, month): ``` It is now clear to the user that it has a limited set of options to chose from. This of course works in combination with default options. ``` Group by (none, day, week, month) [week]: ``` It is possible to disable the display of the choices by passing show_choices=False just like passing show_default=False works. Also added a test for the new behaviour.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+39 added−10 removed
- tests:+17 added−0 removed
- other:+22 added−10 removed