[cli] Fix duplicate arg parsing in _make_call_command

pull/2/head
Daniel Van Der Maden 5 years ago
parent ae8b698996
commit 3c6dc8ddf3
  1. 2
      pyhmy/cli.py

@ -149,7 +149,7 @@ def _make_call_command(command):
if isinstance(command, list): if isinstance(command, list):
command_toks = command command_toks = command
else: else:
all_strings = re.findall(r'"(.*?)"', command) all_strings = sorted(re.findall(r'"(.*?)"', command), key=lambda e: len(e), reverse=True)
for i, string in enumerate(all_strings): for i, string in enumerate(all_strings):
command = command.replace(string, f"{_arg_prefix}_{i}") command = command.replace(string, f"{_arg_prefix}_{i}")
command_toks_prefix = [el for el in command.split(" ") if el] command_toks_prefix = [el for el in command.split(" ") if el]

Loading…
Cancel
Save