From 1296e9f37866ebd82a16f39a54c17f9e66eec6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Droz?= Date: Fri, 20 Jun 2025 01:56:03 -0300 Subject: [PATCH] interactive input handling with cmd/path containing quotes --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 400fc0e..6199a28 100755 --- a/main.py +++ b/main.py @@ -27,6 +27,7 @@ import logging import os.path import pickle +import shlex import sys from recuperabit import logic, utils @@ -368,10 +369,12 @@ def main(): while True: print('\nWrite command ("help" for details):') try: - command = input('> ').split(' ') + command = shlex.split(input('> ').strip()) except (EOFError, KeyboardInterrupt): print('') exit(0) + if len(command) == 0: + continue cmd = command[0] arguments = command[1:] interpret(cmd, arguments, parts, shorthands, args.outputdir)