summaryrefslogtreecommitdiff
path: root/sftp.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-04-03 04:34:15 +0000
committerDamien Miller <djm@mindrot.org>2020-04-03 15:41:28 +1100
commit9cd40b829a5295cc81fbea8c7d632b2478db6274 (patch)
treef8c2b3d892bab8bbe7d761e76735ff76d4b70dcc /sftp.c
parent6ce51a5da5d333a44e7c74c027f3571f70c39b24 (diff)
upstream: Add a flag to re-enable verbose output when in batch
mode; requested in bz3135; ok dtucker OpenBSD-Commit-ID: 5ad2ed0e6440562ba9c84b666a5bbddc1afe2e2b
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sftp.c b/sftp.c
index fc809dc6e..2cef84db7 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp.c,v 1.198 2020/02/26 11:46:51 dtucker Exp $ */ 1/* $OpenBSD: sftp.c,v 1.199 2020/04/03 04:34:15 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -2375,7 +2375,7 @@ usage(void)
2375int 2375int
2376main(int argc, char **argv) 2376main(int argc, char **argv)
2377{ 2377{
2378 int in, out, ch, err, tmp, port = -1; 2378 int in, out, ch, err, tmp, port = -1, noisy = 0;
2379 char *host = NULL, *user, *cp, *file2 = NULL; 2379 char *host = NULL, *user, *cp, *file2 = NULL;
2380 int debug_level = 0; 2380 int debug_level = 0;
2381 char *file1 = NULL, *sftp_server = NULL; 2381 char *file1 = NULL, *sftp_server = NULL;
@@ -2409,7 +2409,7 @@ main(int argc, char **argv)
2409 infile = stdin; 2409 infile = stdin;
2410 2410
2411 while ((ch = getopt(argc, argv, 2411 while ((ch = getopt(argc, argv,
2412 "1246afhpqrvCc:D:i:l:o:s:S:b:B:F:J:P:R:")) != -1) { 2412 "1246afhNpqrvCc:D:i:l:o:s:S:b:B:F:J:P:R:")) != -1) {
2413 switch (ch) { 2413 switch (ch) {
2414 /* Passed through to ssh(1) */ 2414 /* Passed through to ssh(1) */
2415 case '4': 2415 case '4':
@@ -2473,6 +2473,9 @@ main(int argc, char **argv)
2473 case 'f': 2473 case 'f':
2474 global_fflag = 1; 2474 global_fflag = 1;
2475 break; 2475 break;
2476 case 'N':
2477 noisy = 1; /* Used to clear quiet mode after getopt */
2478 break;
2476 case 'p': 2479 case 'p':
2477 global_pflag = 1; 2480 global_pflag = 1;
2478 break; 2481 break;
@@ -2511,6 +2514,9 @@ main(int argc, char **argv)
2511 if (!isatty(STDERR_FILENO)) 2514 if (!isatty(STDERR_FILENO))
2512 showprogress = 0; 2515 showprogress = 0;
2513 2516
2517 if (noisy)
2518 quiet = 0;
2519
2514 log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1); 2520 log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1);
2515 2521
2516 if (sftp_direct == NULL) { 2522 if (sftp_direct == NULL) {