mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-01-27 15:08:23 +00:00
Allow uppercase "Y" and "N" as answers to boolean questions
This commit is contained in:
parent
695cc0d18a
commit
becd03cbf8
@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Latest
|
||||||
|
|
||||||
|
- [Improvement] Allow uppercase "Y" and "N" as answers to boolean questions
|
||||||
|
|
||||||
## v3.3.4 (2019-04-09)
|
## v3.3.4 (2019-04-09)
|
||||||
|
|
||||||
- [Improvement] Rename `--silent` option to `-y/--yes`
|
- [Improvement] Rename `--silent` option to `-y/--yes`
|
||||||
|
@ -186,9 +186,9 @@ def ask_bool(question, key, config):
|
|||||||
suffix = " [Yn]" if config[key] else " [yN]"
|
suffix = " [Yn]" if config[key] else " [yN]"
|
||||||
answer = click.prompt(
|
answer = click.prompt(
|
||||||
fmt.question(question) + suffix,
|
fmt.question(question) + suffix,
|
||||||
type=click.Choice(["y", "n"]),
|
type=click.Choice(["y", "Y", "n", "N"]),
|
||||||
prompt_suffix=" ", default=default, show_default=False, show_choices=False,
|
prompt_suffix=" ", default=default, show_default=False, show_choices=False,
|
||||||
)
|
).lower()
|
||||||
config[key] = answer == "y"
|
config[key] = answer == "y"
|
||||||
|
|
||||||
def ask_choice(question, key, config, choices):
|
def ask_choice(question, key, config, choices):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user