From f2123bef0498cfcc900985173f9ee85ce6766e24 Mon Sep 17 00:00:00 2001 From: GaspardCulis Date: Fri, 5 Jan 2024 17:58:42 +0100 Subject: [PATCH] sync: Added empty user_action check --- sync | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sync b/sync index beed8d9..4be3c82 100755 --- a/sync +++ b/sync @@ -135,11 +135,13 @@ def list_files(reverse: bool = False) -> list[int]: colon = ":" * len_len user_action = input( f"{bcolors.BOLD}{bcolors.BLUE}{colon}{bcolors.ENDC} {bcolors.BOLD}Files to sync (eg: 1 2 3, 1-3):\n{bcolors.BLUE}{colon}{bcolors.ENDC} " - ) + ).strip() # Parse input out = [] - if user_action.count("-") == 0: + if user_action == "": + pass + elif user_action.count("-") == 0: out = list(map(lambda x: int(x), user_action.split())) elif user_action.count("-") == 1: out = list(range(*map(lambda x: int(x), user_action.split("-"))))