summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-10-07 14:54:35 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-10-07 14:54:35 +0200
commit981c3bbe0489789f4b529d2d9f6c5158628a109b (patch)
tree2e139bdbbafd4c929cdf4ae60886af21e0ac2240
parent8bb3a95ce1577e2c8282e7d1c2830bde87cf5c3b (diff)
downloadcurl-bagder/no-progress-meter.tar.gz
curl: --no-progress-meterbagder/no-progress-meter
New option that allows a user to ONLY switch off curl's progress meter and leave everything else in "talkative" mode. Fixes #4422
-rw-r--r--docs/cmdline-opts/progress-meter.d8
-rw-r--r--src/tool_getparam.c16
-rw-r--r--src/tool_help.c2
3 files changed, 21 insertions, 5 deletions
diff --git a/docs/cmdline-opts/progress-meter.d b/docs/cmdline-opts/progress-meter.d
new file mode 100644
index 000000000..3befb0ca0
--- /dev/null
+++ b/docs/cmdline-opts/progress-meter.d
@@ -0,0 +1,8 @@
+Long: progress-meter
+Help: Show the progress meter
+See-also: verbose silent
+Added: 7.67.0
+---
+Option to only switch the progress meter output on or off (with
+--no-progress-meter) without muting or otherwise affecting warning and
+informational messages like --silent does.
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 2012a91ac..3882cb97e 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -322,6 +322,7 @@ static const struct LongShort aliases[]= {
{"Z", "parallel", ARG_BOOL},
{"Zb", "parallel-max", ARG_STRING},
{"#", "progress-bar", ARG_BOOL},
+ {"#m", "progress-meter", ARG_BOOL},
{":", "next", ARG_NONE},
};
@@ -1172,11 +1173,16 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
break;
}
break;
- case '#': /* --progress-bar */
- if(toggle)
- global->progressmode = CURL_PROGRESS_BAR;
- else
- global->progressmode = CURL_PROGRESS_STATS;
+ case '#':
+ switch(subletter) {
+ case 'm': /* --progress-meter */
+ global->noprogress = !toggle;
+ break;
+ default: /* --progress-bar */
+ global->progressmode =
+ toggle ? CURL_PROGRESS_BAR : CURL_PROGRESS_STATS;
+ break;
+ }
break;
case ':': /* --next */
return PARAM_NEXT_OPERATION;
diff --git a/src/tool_help.c b/src/tool_help.c
index ea78821f6..cc7acb017 100644
--- a/src/tool_help.c
+++ b/src/tool_help.c
@@ -295,6 +295,8 @@ static const struct helptxt helptext[] = {
"Use this proxy first"},
{"-#, --progress-bar",
"Display transfer progress as a bar"},
+ {" --progress-meter",
+ "Show the progress meter"},
{" --proto <protocols>",
"Enable/disable PROTOCOLS"},
{" --proto-default <protocol>",