From 80bc9b3dee310de86c6ca88db0edf55d8337f2c1 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 8 Jul 2022 22:28:26 +1000 Subject: [PATCH] tools/mpremote: Don't be verbose when using cat command. Fixes issue #8828. Signed-off-by: Damien George --- tools/mpremote/mpremote/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/mpremote/mpremote/main.py b/tools/mpremote/mpremote/main.py index 4d74743aa3..e0266fd719 100644 --- a/tools/mpremote/mpremote/main.py +++ b/tools/mpremote/mpremote/main.py @@ -308,6 +308,9 @@ def do_filesystem(pyb, args): else: files.append(os.path.split(path)) + # Don't be verbose when using cat, so output can be redirected to something. + verbose = args[0] != "cat" + if args[0] == "cp" and args[1] == "-r": args.pop(0) args.pop(0) @@ -329,9 +332,10 @@ def do_filesystem(pyb, args): pyb, ["cp", "/".join((dir, file)), ":" + dir + "/"], progress_callback=show_progress_bar, + verbose=verbose, ) else: - pyboard.filesystem_command(pyb, args, progress_callback=show_progress_bar) + pyboard.filesystem_command(pyb, args, progress_callback=show_progress_bar, verbose=verbose) args.clear()