mirror of
https://github.com/moparisthebest/curl
synced 2024-12-23 00:28:48 -05:00
tool_operate: Simplified parse .curlrc decision logic
This commit is contained in:
parent
b811200f64
commit
8034b08e0e
@ -239,24 +239,17 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
|
|||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if((argc > 1) &&
|
/* Parse .curlrc if necessary */
|
||||||
(!curlx_strnequal("--", argv[1], 2) && (argv[1][0] == '-')) &&
|
if((argc == 1) || (!curlx_strequal(argv[1], "-q"))) {
|
||||||
strchr(argv[1], 'q')) {
|
|
||||||
/*
|
|
||||||
* The first flag, that is not a verbose name, but a shortname
|
|
||||||
* and it includes the 'q' flag!
|
|
||||||
*/
|
|
||||||
;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
parseconfig(NULL, config); /* ignore possible failure */
|
parseconfig(NULL, config); /* ignore possible failure */
|
||||||
}
|
|
||||||
|
|
||||||
if((argc < 2) && !config->url_list) {
|
/* If we had no arguments then make sure a url was specified in .curlrc */
|
||||||
|
if((argc < 2) && (!config->url_list)) {
|
||||||
helpf(config->errors, NULL);
|
helpf(config->errors, NULL);
|
||||||
res = CURLE_FAILED_INIT;
|
res = CURLE_FAILED_INIT;
|
||||||
goto quit_curl;
|
goto quit_curl;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Parse options */
|
/* Parse options */
|
||||||
for(i = 1, stillflags = TRUE; i < argc; i++) {
|
for(i = 1, stillflags = TRUE; i < argc; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user