1
0
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:
Steve Holme 2014-02-23 10:16:36 +00:00
parent e6e8b14405
commit c10bf9bb36
4 changed files with 8 additions and 4 deletions

View File

@ -1701,10 +1701,8 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
config->tracetype = TRACE_NONE; config->tracetype = TRACE_NONE;
break; break;
case 'V': case 'V':
if(toggle) { /* --no-version yields no output! */ if(toggle) /* --no-version yields no output! */
tool_version_info(); return PARAM_VERSION_INFO_REQUESTED;
return PARAM_HELP_REQUESTED;
}
break; break;
case 'w': case 'w':
@ -1866,6 +1864,7 @@ ParameterError parse_args(struct Configurable *config, int argc,
} }
if(result && result != PARAM_HELP_REQUESTED && if(result && result != PARAM_HELP_REQUESTED &&
result != PARAM_VERSION_INFO_REQUESTED &&
result != PARAM_ENGINES_REQUESTED) { result != PARAM_ENGINES_REQUESTED) {
const char *reason = param2text(result); const char *reason = param2text(result);

View File

@ -30,6 +30,7 @@ typedef enum {
PARAM_REQUIRES_PARAMETER, PARAM_REQUIRES_PARAMETER,
PARAM_BAD_USE, PARAM_BAD_USE,
PARAM_HELP_REQUESTED, PARAM_HELP_REQUESTED,
PARAM_VERSION_INFO_REQUESTED,
PARAM_ENGINES_REQUESTED, PARAM_ENGINES_REQUESTED,
PARAM_GOT_EXTRA_PARAMETER, PARAM_GOT_EXTRA_PARAMETER,
PARAM_BAD_NUMERIC, PARAM_BAD_NUMERIC,

View File

@ -1828,6 +1828,9 @@ CURLcode operate(struct Configurable *config, int argc, argv_item_t argv[])
if(res) { if(res) {
result = CURLE_OK; 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 */ /* Check if we were asked to list the SSL engines */
if(res == PARAM_ENGINES_REQUESTED) if(res == PARAM_ENGINES_REQUESTED)
tool_list_engines(config->easy); tool_list_engines(config->easy);

View File

@ -231,6 +231,7 @@ int parseconfig(const char *filename,
filename = (char *)"<stdin>"; filename = (char *)"<stdin>";
} }
if(res != PARAM_HELP_REQUESTED && if(res != PARAM_HELP_REQUESTED &&
res != PARAM_VERSION_INFO_REQUESTED &&
res != PARAM_ENGINES_REQUESTED) { res != PARAM_ENGINES_REQUESTED) {
const char *reason = param2text(res); const char *reason = param2text(res);
warnf(config, "%s:%d: warning: '%s' %s\n", warnf(config, "%s:%d: warning: '%s' %s\n",