2018-10-17 10:57:56 +02:00
|
|
|
# HG changeset patch
|
|
|
|
# Parent 60bdbe6dd8d6bc011883472363d56e1d97f68835
|
|
|
|
Put back sftp client diagnostic messages in batch mode
|
|
|
|
|
2019-10-10 15:32:50 +02:00
|
|
|
diff --git a/sftp.1 b/sftp.1
|
2020-06-06 08:49:00 +02:00
|
|
|
index a305b37..6e802ec 100644
|
2019-10-10 15:32:50 +02:00
|
|
|
--- a/sftp.1
|
|
|
|
+++ b/sftp.1
|
2020-06-06 08:49:00 +02:00
|
|
|
@@ -282,6 +282,9 @@ Specifies the port to connect to on the remote host.
|
2018-10-17 10:57:56 +02:00
|
|
|
.It Fl p
|
|
|
|
Preserves modification times, access times, and modes from the
|
|
|
|
original files transferred.
|
|
|
|
+.It Fl Q
|
|
|
|
+Not-so-quiet batch mode: forces printing of diagnostic messages
|
|
|
|
+in batch mode.
|
|
|
|
.It Fl q
|
|
|
|
Quiet mode: disables the progress meter as well as warning and
|
|
|
|
diagnostic messages from
|
2019-10-10 15:32:50 +02:00
|
|
|
diff --git a/sftp.c b/sftp.c
|
2020-06-06 08:49:00 +02:00
|
|
|
index 2799e4a..52b2c23 100644
|
2019-10-10 15:32:50 +02:00
|
|
|
--- a/sftp.c
|
|
|
|
+++ b/sftp.c
|
|
|
|
@@ -85,6 +85,9 @@ static volatile pid_t sshpid = -1;
|
2018-10-17 10:57:56 +02:00
|
|
|
/* Suppress diagnositic messages */
|
|
|
|
int quiet = 0;
|
|
|
|
|
|
|
|
+/* Force diagnositic messages in batch mode */
|
|
|
|
+int loud = 0;
|
|
|
|
+
|
|
|
|
/* This is set to 0 if the progressmeter is not desired. */
|
|
|
|
int showprogress = 1;
|
|
|
|
|
2020-06-06 08:49:00 +02:00
|
|
|
@@ -2409,7 +2412,7 @@ main(int argc, char **argv)
|
2018-10-17 10:57:56 +02:00
|
|
|
infile = stdin;
|
|
|
|
|
|
|
|
while ((ch = getopt(argc, argv,
|
2020-06-06 08:49:00 +02:00
|
|
|
- "1246afhNpqrvCc:D:i:l:o:s:S:b:B:F:J:P:R:")) != -1) {
|
|
|
|
+ "1246afhNpQqrvCc:D:i:l:o:s:S:b:B:F:J:P:R:")) != -1) {
|
2018-10-17 10:57:56 +02:00
|
|
|
switch (ch) {
|
|
|
|
/* Passed through to ssh(1) */
|
|
|
|
case '4':
|
2020-06-06 08:49:00 +02:00
|
|
|
@@ -2426,6 +2429,9 @@ main(int argc, char **argv)
|
2018-10-17 10:57:56 +02:00
|
|
|
addargs(&args, "-%c", ch);
|
|
|
|
addargs(&args, "%s", optarg);
|
|
|
|
break;
|
|
|
|
+ case 'Q':
|
|
|
|
+ loud = 1;
|
|
|
|
+ break;
|
|
|
|
case 'q':
|
|
|
|
ll = SYSLOG_LEVEL_ERROR;
|
|
|
|
quiet = 1;
|
2020-06-06 08:49:00 +02:00
|
|
|
@@ -2510,6 +2516,8 @@ main(int argc, char **argv)
|
2018-10-17 10:57:56 +02:00
|
|
|
usage();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ if (batchmode && loud)
|
|
|
|
+ quiet = 0;
|
|
|
|
|
|
|
|
if (!isatty(STDERR_FILENO))
|
|
|
|
showprogress = 0;
|