diff options
author | Steve Holme <steve_holme@hotmail.com> | 2014-02-22 17:45:38 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2014-02-22 17:47:13 +0000 |
commit | dcbae71812a5fdf4dc4335aa10ea75a2ab1b16d4 (patch) | |
tree | 5fa97b0ad8ee648b7b1b5e7ab988b169a22c4819 /src/tool_getparam.c | |
parent | 67f051051fab4b9665e67a1688d4d0035657b825 (diff) |
tool_getparam: Moved version information into separate function in tool_help
Diffstat (limited to 'src/tool_getparam.c')
-rw-r--r-- | src/tool_getparam.c | 59 |
1 files changed, 5 insertions, 54 deletions
diff --git a/src/tool_getparam.c b/src/tool_getparam.c index d54df22d6..5e7962cfc 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -43,7 +43,6 @@ #include "tool_msgs.h" #include "tool_paramhlp.h" #include "tool_parsecfg.h" -#include "tool_version.h" #include "memdebug.h" /* keep this as LAST include */ @@ -276,31 +275,6 @@ static const struct LongShort aliases[]= { {"~", "xattr", FALSE}, }; -struct feat { - const char *name; - int bitmask; -}; - -static const struct feat feats[] = { - {"AsynchDNS", CURL_VERSION_ASYNCHDNS}, - {"Debug", CURL_VERSION_DEBUG}, - {"TrackMemory", CURL_VERSION_CURLDEBUG}, - {"GSS-Negotiate", CURL_VERSION_GSSNEGOTIATE}, - {"IDN", CURL_VERSION_IDN}, - {"IPv6", CURL_VERSION_IPV6}, - {"Largefile", CURL_VERSION_LARGEFILE}, - {"NTLM", CURL_VERSION_NTLM}, - {"NTLM_WB", CURL_VERSION_NTLM_WB}, - {"SPNEGO", CURL_VERSION_SPNEGO}, - {"SSL", CURL_VERSION_SSL}, - {"SSPI", CURL_VERSION_SSPI}, - {"krb4", CURL_VERSION_KERBEROS4}, - {"libz", CURL_VERSION_LIBZ}, - {"CharConv", CURL_VERSION_CONV}, - {"TLS-SRP", CURL_VERSION_TLSAUTH_SRP}, - {"HTTP2", CURL_VERSION_HTTP2} -}; - /* Split the argument of -E to 'certname' and 'passphrase' separated by colon. * We allow ':' and '\' to be escaped by '\' so that we can use certificate * nicknames containing ':'. See <https://sourceforge.net/p/curl/bugs/1196/> @@ -1727,35 +1701,12 @@ ParameterError getparameter(char *flag, /* f or -long-flag */ config->tracetype = TRACE_NONE; break; case 'V': - { - const char *const *proto; - - if(!toggle) - /* --no-version yields no output! */ - break; - - printf(CURL_ID "%s\n", curl_version()); - if(curlinfo->protocols) { - printf("Protocols: "); - for(proto = curlinfo->protocols; *proto; ++proto) { - printf("%s ", *proto); - } - puts(""); /* newline */ - } - if(curlinfo->features) { - unsigned int i; - printf("Features: "); - for(i = 0; i < sizeof(feats)/sizeof(feats[0]); i++) { - if(curlinfo->features & feats[i].bitmask) - printf("%s ", feats[i].name); - } -#ifdef USE_METALINK - printf("Metalink "); -#endif - puts(""); /* newline */ + if(toggle) { /* --no-version yields no output! */ + tool_version_info(); + return PARAM_HELP_REQUESTED; } - } - return PARAM_HELP_REQUESTED; + break; + case 'w': /* get the output string */ if('@' == *nextarg) { |