Skip to content

Commit edfc3c3

Browse files
sbngrosssgross-emlix
authored andcommitted
remote/client: adapt scp command
Use features of multifile scp driver Signed-off-by: Sebastian Gross <[email protected]>
1 parent 8fb5f8d commit edfc3c3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

labgrid/remote/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ def ssh(self):
13081308
def scp(self):
13091309
drv = self._get_ssh()
13101310

1311-
res = drv.scp(src=self.args.src, dst=self.args.dst)
1311+
res = drv.scp(src=self.args.files[:-1], dst=self.args.files[-1], recursive=self.args.recursive)
13121312
if res:
13131313
exc = InteractiveCommandError("scp error")
13141314
exc.exitcode = res
@@ -2021,8 +2021,10 @@ def get_parser(auto_doc_mode=False) -> "argparse.ArgumentParser | AutoProgramArg
20212021

20222022
subparser = subparsers.add_parser("scp", help="transfer file via scp")
20232023
subparser.add_argument("--name", "-n", help="optional resource name")
2024-
subparser.add_argument("src", help="source path (use :dir/file for remote side)")
2025-
subparser.add_argument("dst", help="destination path (use :dir/file for remote side)")
2024+
subparser.add_argument("--recursive", "-r", action="store_true", help="copy recursive")
2025+
subparser.add_argument(
2026+
"files", nargs="+", metavar="SRC/DST", help="source and destination path (use :dir/file for remote side)"
2027+
)
20262028
subparser.set_defaults(func=ClientSession.scp)
20272029

20282030
subparser = subparsers.add_parser(

0 commit comments

Comments
 (0)