From d736a2f3f3ea77359d077aaae537410814e86992 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Tue, 30 May 2023 13:25:29 +1000 Subject: [PATCH] tools/mpremote: Allow terminator for shortcut commands. For example, the `reset` shortcut previously allowed an optional delay, but the argument handling cannot handle `reset next-command` as `next-command` will be interpreted as the delay argument. The fix in this commit allows `reset + next-command`. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared --- tools/mpremote/mpremote/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/mpremote/mpremote/main.py b/tools/mpremote/mpremote/main.py index 50a4e334b..e1caee13a 100644 --- a/tools/mpremote/mpremote/main.py +++ b/tools/mpremote/mpremote/main.py @@ -406,6 +406,8 @@ def do_command_expansion(args): cmd = args.pop(0) exp_args, exp_sub, _ = _command_expansions[cmd] for exp_arg in exp_args: + if args and args[0] == "+": + break exp_arg_name = exp_arg[0] if args and "=" not in args[0]: # Argument given without a name.