diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index f27a8e24e9..adbb446270 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -64,7 +64,9 @@ struct Configurable { char *range; long low_speed_limit; long low_speed_time; - bool showerror; + int showerror; /* -1 == unset, default => show errors + 0 => -s is used to NOT show errors + 1 => -S has been used to show errors */ char *userpwd; char *tls_username; char *tls_password; diff --git a/src/tool_getparam.c b/src/tool_getparam.c index bb36b4246e..bd7375fd9d 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -1426,11 +1426,15 @@ ParameterError getparameter(char *flag, /* f or -long-flag */ config->mute = config->noprogress = TRUE; else config->mute = config->noprogress = FALSE; - config->showerror = (!toggle)?TRUE:FALSE; /* toggle off */ + if(config->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. */ + config->showerror = (!toggle)?TRUE:FALSE; /* toggle off */ break; case 'S': /* show errors */ - config->showerror = toggle; /* toggle on if used with -s */ + config->showerror = toggle?1:0; /* toggle on if used with -s */ break; case 't': /* Telnet options */ diff --git a/src/tool_operate.c b/src/tool_operate.c index 481116ddf9..65f4b60b85 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -164,7 +164,7 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[]) /* inits */ config->postfieldsize = -1; - config->showerror = TRUE; + config->showerror = -1; /* will show errors */ config->use_httpget = FALSE; config->create_dirs = FALSE; config->maxredirs = DEFAULT_MAXREDIRS;