mirror of
https://github.com/novoid/filetags.git
synced 2026-02-16 05:54:16 +00:00
Handle EOF (ctrl-d) gracefully
Instead of the traceback it currently throws.
This commit is contained in:
parent
778a2de5a0
commit
cd4e60b559
1 changed files with 6 additions and 1 deletions
|
|
@ -2277,7 +2277,12 @@ def ask_for_tags_text_version(vocabulary, upto9_tags_for_shortcuts, hint_str, ta
|
|||
print_tag_shortcut_with_numbers(hint_str, tag_list)
|
||||
|
||||
logging.debug("interactive mode: asking for tags ...")
|
||||
entered_tags = input(colorama.Style.DIM + 'Tags: ' + colorama.Style.RESET_ALL).strip()
|
||||
try:
|
||||
entered_tags = input(colorama.Style.DIM + 'Tags: ' + colorama.Style.RESET_ALL).strip()
|
||||
except EOFError:
|
||||
logging.info("Received EOF")
|
||||
sys.exit(0)
|
||||
|
||||
return extract_tags_from_argument(entered_tags)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue