Skip to content

Commit

Permalink
tools/mpremote: Allow terminator for shortcut commands.
Browse files Browse the repository at this point in the history
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 <jim.mussared@gmail.com>
  • Loading branch information
jimmo authored and dpgeorge committed Jun 2, 2023
1 parent 7c2c9ea commit d736a2f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/mpremote/mpremote/main.py
Expand Up @@ -406,6 +406,8 @@ def usage_error(cmd, exp_args, msg):
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.
Expand Down

0 comments on commit d736a2f

Please sign in to comment.