sync: Added empty user_action check
This commit is contained in:
parent
d46aef8fcb
commit
f2123bef04
1 changed files with 4 additions and 2 deletions
6
sync
6
sync
|
@ -135,11 +135,13 @@ def list_files(reverse: bool = False) -> list[int]:
|
||||||
colon = ":" * len_len
|
colon = ":" * len_len
|
||||||
user_action = input(
|
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} "
|
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
|
# Parse input
|
||||||
out = []
|
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()))
|
out = list(map(lambda x: int(x), user_action.split()))
|
||||||
elif user_action.count("-") == 1:
|
elif user_action.count("-") == 1:
|
||||||
out = list(range(*map(lambda x: int(x), user_action.split("-"))))
|
out = list(range(*map(lambda x: int(x), user_action.split("-"))))
|
||||||
|
|
Loading…
Reference in a new issue