curl: make --silent work stand-alone

- renamed the struct field to 'silent' to match the cmdline option
- make --show-error toggle independently of --silent
- make --silent independent of ->noprogress as well

By doing this, the three options --silent, --no-progress-meter and
--show-error should work independently of each other and also work with
and without '--no-' prefix as documented.

Reported-by: u20221022 on github
Fixes #10535
Closes #10536
This commit is contained in:
Daniel Stenberg 2023-02-16 16:34:36 +01:00
parent 6d860f1758
commit 6841f2ed5f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 26 additions and 34 deletions

View file

@ -2268,21 +2268,11 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
/* use remote file's time */
config->remote_time = toggle;
break;
case 's':
/* don't show progress meter, don't show errors : */
if(toggle)
global->mute = global->noprogress = TRUE;
else
global->mute = global->noprogress = FALSE;
if(global->showerror < 0)
/* if still on the default value, set showerror to the reverse of
toggle. This is to allow -S and -s to be used in an independent
order but still have the same effect. */
global->showerror = (!toggle)?TRUE:FALSE; /* toggle off */
case 's': /* --silent */
global->silent = toggle;
break;
case 'S':
/* show errors */
global->showerror = toggle?1:0; /* toggle on if used with -s */
case 'S': /* --show-error */
global->showerror = toggle;
break;
case 't':
/* Telnet options */