Skip to content

Commit

Permalink
Fixes #149 as well as --help. This will be added in the next patch re…
Browse files Browse the repository at this point in the history
…lease.
  • Loading branch information
Torxed committed Apr 3, 2021
1 parent 428bf16 commit bb295cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 10 additions & 3 deletions archinstall/lib/user_interaction.py
Expand Up @@ -272,9 +272,16 @@ def select_language(options, show_only_country_codes=True):
print(' -- You can enter ? or help to search for more languages --')
selected_language = input('Select one of the above keyboard languages (by number or full name): ')
if selected_language.lower() in ('?', 'help'):
filter_string = input('Search for layout containing (example: "sv-"): ')
new_options = search_keyboard_layout(filter_string)
return select_language(new_options, show_only_country_codes=False)
while True:
filter_string = input('Search for layout containing (example: "sv-"): ')
new_options = list(search_keyboard_layout(filter_string))

if len(new_options) <= 0:
log(f"Search string '{filter_string}' yielded no results, please try another search or Ctrl+D to abort.", fg='yellow')
continue

return select_language(new_options, show_only_country_codes=False)

elif selected_language.isdigit() and (pos := int(selected_language)) <= len(languages)-1:
selected_language = languages[pos]
# I'm leaving "options" on purpose here.
Expand Down
3 changes: 3 additions & 0 deletions examples/guided.py
Expand Up @@ -19,6 +19,9 @@ def sig_handler(sig, frame):
original_sigint_handler = signal.getsignal(signal.SIGINT)
signal.signal(signal.SIGINT, sig_handler)

if archinstall.arguments.get('help'):
print("See `man archinstall` for help.")
exit(0)

def ask_user_questions():
"""
Expand Down

0 comments on commit bb295cb

Please sign in to comment.