mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 16:18:48 -05:00
tool_getparam: Moved tool_version_info() call into operate()
This commit is contained in:
parent
e6e8b14405
commit
c10bf9bb36
@ -1701,10 +1701,8 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
||||
config->tracetype = TRACE_NONE;
|
||||
break;
|
||||
case 'V':
|
||||
if(toggle) { /* --no-version yields no output! */
|
||||
tool_version_info();
|
||||
return PARAM_HELP_REQUESTED;
|
||||
}
|
||||
if(toggle) /* --no-version yields no output! */
|
||||
return PARAM_VERSION_INFO_REQUESTED;
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
@ -1866,6 +1864,7 @@ ParameterError parse_args(struct Configurable *config, int argc,
|
||||
}
|
||||
|
||||
if(result && result != PARAM_HELP_REQUESTED &&
|
||||
result != PARAM_VERSION_INFO_REQUESTED &&
|
||||
result != PARAM_ENGINES_REQUESTED) {
|
||||
const char *reason = param2text(result);
|
||||
|
||||
|
@ -30,6 +30,7 @@ typedef enum {
|
||||
PARAM_REQUIRES_PARAMETER,
|
||||
PARAM_BAD_USE,
|
||||
PARAM_HELP_REQUESTED,
|
||||
PARAM_VERSION_INFO_REQUESTED,
|
||||
PARAM_ENGINES_REQUESTED,
|
||||
PARAM_GOT_EXTRA_PARAMETER,
|
||||
PARAM_BAD_NUMERIC,
|
||||
|
@ -1828,6 +1828,9 @@ CURLcode operate(struct Configurable *config, int argc, argv_item_t argv[])
|
||||
if(res) {
|
||||
result = CURLE_OK;
|
||||
|
||||
/* Check if we were asked for the version information */
|
||||
if(res == PARAM_VERSION_INFO_REQUESTED)
|
||||
tool_version_info();
|
||||
/* Check if we were asked to list the SSL engines */
|
||||
if(res == PARAM_ENGINES_REQUESTED)
|
||||
tool_list_engines(config->easy);
|
||||
|
@ -231,6 +231,7 @@ int parseconfig(const char *filename,
|
||||
filename = (char *)"<stdin>";
|
||||
}
|
||||
if(res != PARAM_HELP_REQUESTED &&
|
||||
res != PARAM_VERSION_INFO_REQUESTED &&
|
||||
res != PARAM_ENGINES_REQUESTED) {
|
||||
const char *reason = param2text(res);
|
||||
warnf(config, "%s:%d: warning: '%s' %s\n",
|
||||
|
Loading…
Reference in New Issue
Block a user