mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Better prompts for y/n questions
This commit is contained in:
parent
9140567912
commit
8e30a14603
1 changed files with 1 additions and 1 deletions
|
@ -67,7 +67,7 @@ def py23_input(msg):
|
|||
return STDIN.readline().strip()
|
||||
|
||||
def yesno(prompt, default=True):
|
||||
prompt = prompt.strip() + (" [Yn]" if default else "[yN]")
|
||||
prompt = prompt.strip() + (" [Y/n]" if default else " [y/N]")
|
||||
raw = py23_input(prompt)
|
||||
return {'y': True, 'n': False}.get(raw.lower(), default)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue