mirror of
https://github.com/curl/curl.git
synced 2026-07-31 18:08:04 +03:00
tool_getparam: make --fail and --fail-with-body override each other
This allows users to put one of them in their .curlrc and still easily use the other one at will in command lines. Reported-by: Mitchell Blank Jr Fixes #19029
This commit is contained in:
parent
56450ce26f
commit
12a702814f
1 changed files with 4 additions and 6 deletions
|
|
@ -2040,9 +2040,8 @@ static ParameterError opt_bool(struct OperationConfig *config,
|
|||
case C_FAIL_WITH_BODY: /* --fail-with-body */
|
||||
config->failwithbody = toggle;
|
||||
if(config->failonerror && config->failwithbody) {
|
||||
errorf("You must select either --fail or "
|
||||
"--fail-with-body, not both.");
|
||||
return PARAM_BAD_USE;
|
||||
warnf("--fail-with-body deselects --fail here");
|
||||
config->failonerror = FALSE;
|
||||
}
|
||||
break;
|
||||
case C_REMOVE_ON_ERROR: /* --remove-on-error */
|
||||
|
|
@ -2055,9 +2054,8 @@ static ParameterError opt_bool(struct OperationConfig *config,
|
|||
case C_FAIL: /* --fail */
|
||||
config->failonerror = toggle;
|
||||
if(config->failonerror && config->failwithbody) {
|
||||
errorf("You must select either --fail or "
|
||||
"--fail-with-body, not both.");
|
||||
return PARAM_BAD_USE;
|
||||
warnf("--fail deselects --fail-with-body here");
|
||||
config->failwithbody = FALSE;
|
||||
}
|
||||
break;
|
||||
case C_GLOBOFF: /* --globoff */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue