Skip to content
Snippets Groups Projects
Commit 8034b08e authored by Steve Holme's avatar Steve Holme
Browse files

tool_operate: Simplified parse .curlrc decision logic

parent b811200f
No related branches found
No related tags found
No related merge requests found
......@@ -239,23 +239,16 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
setlocale(LC_ALL, "");
#endif
if((argc > 1) &&
(!curlx_strnequal("--", argv[1], 2) && (argv[1][0] == '-')) &&
strchr(argv[1], 'q')) {
/*
* The first flag, that is not a verbose name, but a shortname
* and it includes the 'q' flag!
*/
;
}
else {
/* Parse .curlrc if necessary */
if((argc == 1) || (!curlx_strequal(argv[1], "-q"))) {
parseconfig(NULL, config); /* ignore possible failure */
}
if((argc < 2) && !config->url_list) {
helpf(config->errors, NULL);
res = CURLE_FAILED_INIT;
goto quit_curl;
/* If we had no arguments then make sure a url was specified in .curlrc */
if((argc < 2) && (!config->url_list)) {
helpf(config->errors, NULL);
res = CURLE_FAILED_INIT;
goto quit_curl;
}
}
/* Parse options */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment