From b6b19798c21f8d8da6230c2c588a74997a71a853 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Wed, 31 May 2023 11:16:34 +1000 Subject: [PATCH] tools/mpremote: Handle `cp` without destination. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared --- tools/pyboard.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/pyboard.py b/tools/pyboard.py index 7b546b99d1..0ce2d291e6 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -686,6 +686,10 @@ def filesystem_command(pyb, args, progress_callback=None, verbose=False): args = args[1:] try: if cmd == "cp": + if len(args) == 1: + raise PyboardError( + "cp: missing destination file operand after '{}'".format(args[0]) + ) srcs = args[:-1] dest = args[-1] if dest.startswith(":"):