summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authortb@openbsd.org <tb@openbsd.org>2019-01-21 22:50:42 +0000
committerDamien Miller <djm@mindrot.org>2019-01-22 22:42:01 +1100
commit622dedf1a884f2927a9121e672bd9955e12ba108 (patch)
treede34eb30dd40556cf73ed5e6e6ef3b8c945436b0 /scp.c
parentc882d74652800150d538e22c80dd2bd3cdd5fae2 (diff)
upstream: Add a -J option as a shortcut for -o Proxyjump= to scp(1)
and sftp(1) to match ssh(1)'s interface. ok djm OpenBSD-Commit-ID: a75bc2d5f329caa7229a7e9fe346c4f41c2663fc
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/scp.c b/scp.c
index eb17c3416..ae51137ee 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: scp.c,v 1.198 2018/11/16 03:03:10 djm Exp $ */ 1/* $OpenBSD: scp.c,v 1.199 2019/01/21 22:50:42 tb Exp $ */
2/* 2/*
3 * scp - secure remote copy. This is basically patched BSD rcp which 3 * scp - secure remote copy. This is basically patched BSD rcp which
4 * uses ssh to do the data transfer (instead of using rcmd). 4 * uses ssh to do the data transfer (instead of using rcmd).
@@ -424,7 +424,7 @@ main(int argc, char **argv)
424 addargs(&args, "-oRequestTTY=no"); 424 addargs(&args, "-oRequestTTY=no");
425 425
426 fflag = tflag = 0; 426 fflag = tflag = 0;
427 while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q12346S:o:F:")) != -1) 427 while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q12346S:o:F:J:")) != -1)
428 switch (ch) { 428 switch (ch) {
429 /* User-visible flags. */ 429 /* User-visible flags. */
430 case '1': 430 case '1':
@@ -446,6 +446,7 @@ main(int argc, char **argv)
446 case 'c': 446 case 'c':
447 case 'i': 447 case 'i':
448 case 'F': 448 case 'F':
449 case 'J':
449 addargs(&remote_remote_args, "-%c", ch); 450 addargs(&remote_remote_args, "-%c", ch);
450 addargs(&remote_remote_args, "%s", optarg); 451 addargs(&remote_remote_args, "%s", optarg);
451 addargs(&args, "-%c", ch); 452 addargs(&args, "-%c", ch);
@@ -1319,7 +1320,8 @@ usage(void)
1319{ 1320{
1320 (void) fprintf(stderr, 1321 (void) fprintf(stderr,
1321 "usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]\n" 1322 "usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]\n"
1322 " [-l limit] [-o ssh_option] [-P port] [-S program] source ... target\n"); 1323 " [-J destination] [-l limit] [-o ssh_option] [-P port]\n"
1324 " [-S program] source ... target\n");
1323 exit(1); 1325 exit(1);
1324} 1326}
1325 1327