mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
tool_getparam: Moved version information into separate function in tool_help
This commit is contained in:
parent
67f051051f
commit
dcbae71812
@ -43,7 +43,6 @@
|
|||||||
#include "tool_msgs.h"
|
#include "tool_msgs.h"
|
||||||
#include "tool_paramhlp.h"
|
#include "tool_paramhlp.h"
|
||||||
#include "tool_parsecfg.h"
|
#include "tool_parsecfg.h"
|
||||||
#include "tool_version.h"
|
|
||||||
|
|
||||||
#include "memdebug.h" /* keep this as LAST include */
|
#include "memdebug.h" /* keep this as LAST include */
|
||||||
|
|
||||||
@ -276,31 +275,6 @@ static const struct LongShort aliases[]= {
|
|||||||
{"~", "xattr", FALSE},
|
{"~", "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.
|
/* 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
|
* We allow ':' and '\' to be escaped by '\' so that we can use certificate
|
||||||
* nicknames containing ':'. See <https://sourceforge.net/p/curl/bugs/1196/>
|
* 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;
|
config->tracetype = TRACE_NONE;
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
{
|
if(toggle) { /* --no-version yields no output! */
|
||||||
const char *const *proto;
|
tool_version_info();
|
||||||
|
return PARAM_HELP_REQUESTED;
|
||||||
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) {
|
break;
|
||||||
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 */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return PARAM_HELP_REQUESTED;
|
|
||||||
case 'w':
|
case 'w':
|
||||||
/* get the output string */
|
/* get the output string */
|
||||||
if('@' == *nextarg) {
|
if('@' == *nextarg) {
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#include "tool_panykey.h"
|
#include "tool_panykey.h"
|
||||||
#include "tool_help.h"
|
#include "tool_help.h"
|
||||||
|
#include "tool_libinfo.h"
|
||||||
|
#include "tool_version.h"
|
||||||
|
|
||||||
#include "memdebug.h" /* keep this as LAST include */
|
#include "memdebug.h" /* keep this as LAST include */
|
||||||
|
|
||||||
@ -245,6 +247,31 @@ static const char *const helptext[] = {
|
|||||||
# define PRINT_LINES_PAUSE 16
|
# define PRINT_LINES_PAUSE 16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
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}
|
||||||
|
};
|
||||||
|
|
||||||
void tool_help(void)
|
void tool_help(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -257,6 +284,32 @@ void tool_help(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tool_version_info(void)
|
||||||
|
{
|
||||||
|
const char *const *proto;
|
||||||
|
|
||||||
|
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 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void tool_list_engines(CURL *curl)
|
void tool_list_engines(CURL *curl)
|
||||||
{
|
{
|
||||||
struct curl_slist *engines = NULL;
|
struct curl_slist *engines = NULL;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
void tool_help(void);
|
void tool_help(void);
|
||||||
void tool_list_engines(CURL *curl);
|
void tool_list_engines(CURL *curl);
|
||||||
|
void tool_version_info(void);
|
||||||
|
|
||||||
#endif /* HEADER_CURL_TOOL_HELP_H */
|
#endif /* HEADER_CURL_TOOL_HELP_H */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user