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;
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);

View File

@ -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,

View File

@ -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);

View File

@ -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",