curl: add warning for incompatible parameters usage
--continue-at - and --remote-header-name are known incompatible parameters Closes #7674
This commit is contained in:
parent
033d15a6c5
commit
7a3e981781
@ -1890,11 +1890,6 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
if(config->content_disposition) {
|
|
||||||
warnf(global,
|
|
||||||
"--include and --remote-header-name cannot be combined.\n");
|
|
||||||
return PARAM_BAD_USE;
|
|
||||||
}
|
|
||||||
config->show_headers = toggle; /* show the headers as well in the
|
config->show_headers = toggle; /* show the headers as well in the
|
||||||
general output stream */
|
general output stream */
|
||||||
break;
|
break;
|
||||||
@ -1910,11 +1905,6 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||||||
return PARAM_BAD_USE;
|
return PARAM_BAD_USE;
|
||||||
break;
|
break;
|
||||||
case 'J': /* --remote-header-name */
|
case 'J': /* --remote-header-name */
|
||||||
if(config->show_headers) {
|
|
||||||
warnf(global,
|
|
||||||
"--include and --remote-header-name cannot be combined.\n");
|
|
||||||
return PARAM_BAD_USE;
|
|
||||||
}
|
|
||||||
config->content_disposition = toggle;
|
config->content_disposition = toggle;
|
||||||
break;
|
break;
|
||||||
case 'k': /* allow insecure SSL connects */
|
case 'k': /* allow insecure SSL connects */
|
||||||
@ -2394,6 +2384,19 @@ ParameterError parse_args(struct GlobalConfig *global, int argc,
|
|||||||
curlx_unicodefree(orig_opt);
|
curlx_unicodefree(orig_opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(config->content_disposition) {
|
||||||
|
if(config->show_headers) {
|
||||||
|
helpf(global->errors, "--include and --remote-header-name "
|
||||||
|
"cannot be combined.\n");
|
||||||
|
return PARAM_BAD_USE;
|
||||||
|
}
|
||||||
|
if(config->resume_from_current) {
|
||||||
|
helpf(global->errors, "--continue-at - and --remote-header-name "
|
||||||
|
"cannot be combined.\n");
|
||||||
|
return PARAM_BAD_USE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(result && result != PARAM_HELP_REQUESTED &&
|
if(result && result != PARAM_HELP_REQUESTED &&
|
||||||
result != PARAM_MANUAL_REQUESTED &&
|
result != PARAM_MANUAL_REQUESTED &&
|
||||||
result != PARAM_VERSION_INFO_REQUESTED &&
|
result != PARAM_VERSION_INFO_REQUESTED &&
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user