mirror of
https://github.com/curl/curl.git
synced 2026-07-25 16:47:16 +03:00
curl: add --fail-with-body
Prevent both --fail and --fail-with-body on the same command line. Verify with test 349, 360 and 361. Closes #6449
This commit is contained in:
parent
c386a0df44
commit
8a964cb217
13 changed files with 179 additions and 14 deletions
|
|
@ -280,6 +280,7 @@ static const struct LongShort aliases[]= {
|
|||
{"fa", "fail-early", ARG_BOOL},
|
||||
{"fb", "styled-output", ARG_BOOL},
|
||||
{"fc", "mail-rcpt-allowfails", ARG_BOOL},
|
||||
{"fd", "fail-with-body", ARG_BOOL},
|
||||
{"F", "form", ARG_STRING},
|
||||
{"Fs", "form-string", ARG_STRING},
|
||||
{"g", "globoff", ARG_BOOL},
|
||||
|
|
@ -1766,8 +1767,17 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
case 'c': /* --mail-rcpt-allowfails */
|
||||
config->mail_rcpt_allowfails = toggle;
|
||||
break;
|
||||
case 'd': /* --fail-with-body */
|
||||
config->failwithbody = toggle;
|
||||
break;
|
||||
default: /* --fail (hard on errors) */
|
||||
config->failonerror = toggle;
|
||||
break;
|
||||
}
|
||||
if(config->failonerror && config->failwithbody) {
|
||||
errorf(config->global, "You must select either --fail or "
|
||||
"--fail-with-body, not both.\n");
|
||||
return PARAM_BAD_USE;
|
||||
}
|
||||
break;
|
||||
case 'F':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue