mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-04-27 20:52:27 +00:00
Multiline options print
This commit is contained in:
parent
2847ad6578
commit
309f8d0da3
1 changed files with 2 additions and 5 deletions
7
lib.py
7
lib.py
|
@ -184,13 +184,10 @@ class Input:
|
|||
|
||||
Print.question(question)
|
||||
|
||||
options_str = '0: No/Cancel / '
|
||||
Print.question_options('0: No/Cancel')
|
||||
for index, option in enumerate(options):
|
||||
options_str += f'{index + 1}: {option} / '
|
||||
# Remove ending ' / '
|
||||
options_str = options_str[:-3]
|
||||
Print.question_options(f'{index + 1}: {option}')
|
||||
|
||||
Print.question_options(options_str)
|
||||
answer = get_input_range(len(options))
|
||||
if answer != 0:
|
||||
return options[answer - 1]
|
||||
|
|
Loading…
Add table
Reference in a new issue