click
click copied to clipboard
Add format customization flow to `click.prompt` and `click.confirm` via `PromptBuilder` class
This PR implements a base class which allows to customize prompt format when used directly via click.prompt or click.confirm methods.
It adds an optional parameter which can be an instance of a PromptBuilder class or one inheriting from it.
You can customize all of the below in any combination:
- how the prompt is built via overriding
buildmethod - how the choices are shown via overriding
add_choicesmethod - how the default is shown via overriding
add_defaultmethod - how to calculate if choices should be shown via overriding
should_add_choicesmethod - how to calculate if default should be shown via overriding
should_add_defaultmethod
fixes #2875
Tests pass, but I am not sure, based on the logs, why do the other jobs fail. Would appreciate some help in this regard.