From cbb8b6e16bc7446d29826df57485a36ea09a5063 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 11 Mar 2022 15:04:52 +0100 Subject: [PATCH] update cp script to allow copying multiple files --- scripts/q7s-cp.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/q7s-cp.py b/scripts/q7s-cp.py index 4666dfa1..3df6d662 100755 --- a/scripts/q7s-cp.py +++ b/scripts/q7s-cp.py @@ -58,7 +58,8 @@ def handle_args(): ) # Positional argument(s) parser.add_argument( - "source", help="Source files to copy or target files to copy back to host" + "source", help="Source files to copy or target files to copy back to host", + nargs="+" ) return parser.parse_args() @@ -71,6 +72,10 @@ def build_cmd(args): address = "" port_args = "" target = args.target + if args.invert and len(args.source) > 1: + print("Multiple source files not allowed for inverse copying") + sys.exit(1) + source_files = " ".join(args.source) if args.flatsat: address = "eive@flatsat.eive.absatvirt.lw" else: @@ -89,7 +94,7 @@ def build_cmd(args): if args.invert: cmd += f"{port_args} {address}:{args.source} {target}" else: - cmd += f"{port_args} {args.source} {address}:{target}" + cmd += f"{port_args} {source_files} {address}:{target}" return cmd