File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / curl / src / tool_help.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Jun 3 10:01:15 2020 UTC (4 years, 10 months ago) by misho
Branches: curl, MAIN
CVS tags: v7_70_0p4, HEAD
curl

    1: /***************************************************************************
    2:  *                                  _   _ ____  _
    3:  *  Project                     ___| | | |  _ \| |
    4:  *                             / __| | | | |_) | |
    5:  *                            | (__| |_| |  _ <| |___
    6:  *                             \___|\___/|_| \_\_____|
    7:  *
    8:  * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
    9:  *
   10:  * This software is licensed as described in the file COPYING, which
   11:  * you should have received as part of this distribution. The terms
   12:  * are also available at https://curl.haxx.se/docs/copyright.html.
   13:  *
   14:  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
   15:  * copies of the Software, and permit persons to whom the Software is
   16:  * furnished to do so, under the terms of the COPYING file.
   17:  *
   18:  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
   19:  * KIND, either express or implied.
   20:  *
   21:  ***************************************************************************/
   22: #include "tool_setup.h"
   23: #if defined(HAVE_STRCASECMP) && defined(HAVE_STRINGS_H)
   24: #include <strings.h>
   25: #endif
   26: 
   27: #include "tool_panykey.h"
   28: #include "tool_help.h"
   29: #include "tool_libinfo.h"
   30: #include "tool_version.h"
   31: 
   32: #include "memdebug.h" /* keep this as LAST include */
   33: 
   34: #ifdef MSDOS
   35: #  define USE_WATT32
   36: #endif
   37: 
   38: /*
   39:  * The help output is generated with the following command
   40:  ---------------------------------------------------------
   41: 
   42:   cd $srcroot/docs/cmdline-opts
   43:   ./gen.pl listhelp *.d
   44:  */
   45: 
   46: struct helptxt {
   47:   const char *opt;
   48:   const char *desc;
   49: };
   50: 
   51: static const struct helptxt helptext[] = {
   52:   {"    --abstract-unix-socket <path>",
   53:    "Connect via abstract Unix domain socket"},
   54:   {"    --alt-svc <file name>",
   55:    "Enable alt-svc with this cache file"},
   56:   {"    --anyauth",
   57:    "Pick any authentication method"},
   58:   {"-a, --append",
   59:    "Append to target file when uploading"},
   60:   {"    --basic",
   61:    "Use HTTP Basic Authentication"},
   62:   {"    --cacert <file>",
   63:    "CA certificate to verify peer against"},
   64:   {"    --capath <dir>",
   65:    "CA directory to verify peer against"},
   66:   {"-E, --cert <certificate[:password]>",
   67:    "Client certificate file and password"},
   68:   {"    --cert-status",
   69:    "Verify the status of the server certificate"},
   70:   {"    --cert-type <type>",
   71:    "Certificate file type (DER/PEM/ENG)"},
   72:   {"    --ciphers <list of ciphers>",
   73:    "SSL ciphers to use"},
   74:   {"    --compressed",
   75:    "Request compressed response"},
   76:   {"    --compressed-ssh",
   77:    "Enable SSH compression"},
   78:   {"-K, --config <file>",
   79:    "Read config from a file"},
   80:   {"    --connect-timeout <seconds>",
   81:    "Maximum time allowed for connection"},
   82:   {"    --connect-to <HOST1:PORT1:HOST2:PORT2>",
   83:    "Connect to host"},
   84:   {"-C, --continue-at <offset>",
   85:    "Resumed transfer offset"},
   86:   {"-b, --cookie <data|filename>",
   87:    "Send cookies from string/file"},
   88:   {"-c, --cookie-jar <filename>",
   89:    "Write cookies to <filename> after operation"},
   90:   {"    --create-dirs",
   91:    "Create necessary local directory hierarchy"},
   92:   {"    --crlf",
   93:    "Convert LF to CRLF in upload"},
   94:   {"    --crlfile <file>",
   95:    "Get a CRL list in PEM format from the given file"},
   96:   {"-d, --data <data>",
   97:    "HTTP POST data"},
   98:   {"    --data-ascii <data>",
   99:    "HTTP POST ASCII data"},
  100:   {"    --data-binary <data>",
  101:    "HTTP POST binary data"},
  102:   {"    --data-raw <data>",
  103:    "HTTP POST data, '@' allowed"},
  104:   {"    --data-urlencode <data>",
  105:    "HTTP POST data url encoded"},
  106:   {"    --delegation <LEVEL>",
  107:    "GSS-API delegation permission"},
  108:   {"    --digest",
  109:    "Use HTTP Digest Authentication"},
  110:   {"-q, --disable",
  111:    "Disable .curlrc"},
  112:   {"    --disable-eprt",
  113:    "Inhibit using EPRT or LPRT"},
  114:   {"    --disable-epsv",
  115:    "Inhibit using EPSV"},
  116:   {"    --disallow-username-in-url",
  117:    "Disallow username in url"},
  118:   {"    --dns-interface <interface>",
  119:    "Interface to use for DNS requests"},
  120:   {"    --dns-ipv4-addr <address>",
  121:    "IPv4 address to use for DNS requests"},
  122:   {"    --dns-ipv6-addr <address>",
  123:    "IPv6 address to use for DNS requests"},
  124:   {"    --dns-servers <addresses>",
  125:    "DNS server addrs to use"},
  126:   {"    --doh-url <URL>",
  127:    "Resolve host names over DOH"},
  128:   {"-D, --dump-header <filename>",
  129:    "Write the received headers to <filename>"},
  130:   {"    --egd-file <file>",
  131:    "EGD socket path for random data"},
  132:   {"    --engine <name>",
  133:    "Crypto engine to use"},
  134:   {"    --etag-save <file>",
  135:    "Get an ETag from response header and save it to a FILE"},
  136:   {"    --etag-compare <file>",
  137:    "Get an ETag from a file and send a conditional request"},
  138:   {"    --expect100-timeout <seconds>",
  139:    "How long to wait for 100-continue"},
  140:   {"-f, --fail",
  141:    "Fail silently (no output at all) on HTTP errors"},
  142:   {"    --fail-early",
  143:    "Fail on first transfer error, do not continue"},
  144:   {"    --false-start",
  145:    "Enable TLS False Start"},
  146:   {"-F, --form <name=content>",
  147:    "Specify multipart MIME data"},
  148:   {"    --form-string <name=string>",
  149:    "Specify multipart MIME data"},
  150:   {"    --ftp-account <data>",
  151:    "Account data string"},
  152:   {"    --ftp-alternative-to-user <command>",
  153:    "String to replace USER [name]"},
  154:   {"    --ftp-create-dirs",
  155:    "Create the remote dirs if not present"},
  156:   {"    --ftp-method <method>",
  157:    "Control CWD usage"},
  158:   {"    --ftp-pasv",
  159:    "Use PASV/EPSV instead of PORT"},
  160:   {"-P, --ftp-port <address>",
  161:    "Use PORT instead of PASV"},
  162:   {"    --ftp-pret",
  163:    "Send PRET before PASV"},
  164:   {"    --ftp-skip-pasv-ip",
  165:    "Skip the IP address for PASV"},
  166:   {"    --ftp-ssl-ccc",
  167:    "Send CCC after authenticating"},
  168:   {"    --ftp-ssl-ccc-mode <active/passive>",
  169:    "Set CCC mode"},
  170:   {"    --ftp-ssl-control",
  171:    "Require SSL/TLS for FTP login, clear for transfer"},
  172:   {"-G, --get",
  173:    "Put the post data in the URL and use GET"},
  174:   {"-g, --globoff",
  175:    "Disable URL sequences and ranges using {} and []"},
  176:   {"    --happy-eyeballs-timeout-ms <milliseconds>",
  177:    "How long to wait in milliseconds for IPv6 before trying IPv4"},
  178:   {"    --haproxy-protocol",
  179:    "Send HAProxy PROXY protocol v1 header"},
  180:   {"-I, --head",
  181:    "Show document info only"},
  182:   {"-H, --header <header/@file>",
  183:    "Pass custom header(s) to server"},
  184:   {"-h, --help",
  185:    "This help text"},
  186:   {"    --hostpubmd5 <md5>",
  187:    "Acceptable MD5 hash of the host public key"},
  188:   {"    --http0.9",
  189:    "Allow HTTP 0.9 responses"},
  190:   {"-0, --http1.0",
  191:    "Use HTTP 1.0"},
  192:   {"    --http1.1",
  193:    "Use HTTP 1.1"},
  194:   {"    --http2",
  195:    "Use HTTP 2"},
  196:   {"    --http2-prior-knowledge",
  197:    "Use HTTP 2 without HTTP/1.1 Upgrade"},
  198:   {"    --http3",
  199:    "Use HTTP v3"},
  200:   {"    --ignore-content-length",
  201:    "Ignore the size of the remote resource"},
  202:   {"-i, --include",
  203:    "Include protocol response headers in the output"},
  204:   {"-k, --insecure",
  205:    "Allow insecure server connections when using SSL"},
  206:   {"    --interface <name>",
  207:    "Use network INTERFACE (or address)"},
  208:   {"-4, --ipv4",
  209:    "Resolve names to IPv4 addresses"},
  210:   {"-6, --ipv6",
  211:    "Resolve names to IPv6 addresses"},
  212:   {"-j, --junk-session-cookies",
  213:    "Ignore session cookies read from file"},
  214:   {"    --keepalive-time <seconds>",
  215:    "Interval time for keepalive probes"},
  216:   {"    --key <key>",
  217:    "Private key file name"},
  218:   {"    --key-type <type>",
  219:    "Private key file type (DER/PEM/ENG)"},
  220:   {"    --krb <level>",
  221:    "Enable Kerberos with security <level>"},
  222:   {"    --libcurl <file>",
  223:    "Dump libcurl equivalent code of this command line"},
  224:   {"    --limit-rate <speed>",
  225:    "Limit transfer speed to RATE"},
  226:   {"-l, --list-only",
  227:    "List only mode"},
  228:   {"    --local-port <num/range>",
  229:    "Force use of RANGE for local port numbers"},
  230:   {"-L, --location",
  231:    "Follow redirects"},
  232:   {"    --location-trusted",
  233:    "Like --location, and send auth to other hosts"},
  234:   {"    --login-options <options>",
  235:    "Server login options"},
  236:   {"    --mail-auth <address>",
  237:    "Originator address of the original email"},
  238:   {"    --mail-from <address>",
  239:    "Mail from this address"},
  240:   {"    --mail-rcpt <address>",
  241:    "Mail to this address"},
  242:   {"    --mail-rcpt-allowfails",
  243:    "Allow RCPT TO command to fail for some recipients"},
  244:   {"-M, --manual",
  245:    "Display the full manual"},
  246:   {"    --max-filesize <bytes>",
  247:    "Maximum file size to download"},
  248:   {"    --max-redirs <num>",
  249:    "Maximum number of redirects allowed"},
  250:   {"-m, --max-time <seconds>",
  251:    "Maximum time allowed for the transfer"},
  252:   {"    --metalink",
  253:    "Process given URLs as metalink XML file"},
  254:   {"    --negotiate",
  255:    "Use HTTP Negotiate (SPNEGO) authentication"},
  256:   {"-n, --netrc",
  257:    "Must read .netrc for user name and password"},
  258:   {"    --netrc-file <filename>",
  259:    "Specify FILE for netrc"},
  260:   {"    --netrc-optional",
  261:    "Use either .netrc or URL"},
  262:   {"-:, --next",
  263:    "Make next URL use its separate set of options"},
  264:   {"    --no-alpn",
  265:    "Disable the ALPN TLS extension"},
  266:   {"-N, --no-buffer",
  267:    "Disable buffering of the output stream"},
  268:   {"    --no-keepalive",
  269:    "Disable TCP keepalive on the connection"},
  270:   {"    --no-npn",
  271:    "Disable the NPN TLS extension"},
  272:   {"    --no-progress-meter",
  273:    "Do not show the progress meter"},
  274:   {"    --no-sessionid",
  275:    "Disable SSL session-ID reusing"},
  276:   {"    --noproxy <no-proxy-list>",
  277:    "List of hosts which do not use proxy"},
  278:   {"    --ntlm",
  279:    "Use HTTP NTLM authentication"},
  280:   {"    --ntlm-wb",
  281:    "Use HTTP NTLM authentication with winbind"},
  282:   {"    --oauth2-bearer <token>",
  283:    "OAuth 2 Bearer Token"},
  284:   {"-o, --output <file>",
  285:    "Write to file instead of stdout"},
  286:   {"-Z, --parallel",
  287:    "Perform transfers in parallel"},
  288:   {"    --parallel-immediate",
  289:    "Do not wait for multiplexing (with --parallel)"},
  290:   {"    --parallel-max",
  291:    "Maximum concurrency for parallel transfers"},
  292:   {"    --pass <phrase>",
  293:    "Pass phrase for the private key"},
  294:   {"    --path-as-is",
  295:    "Do not squash .. sequences in URL path"},
  296:   {"    --pinnedpubkey <hashes>",
  297:    "FILE/HASHES Public key to verify peer against"},
  298:   {"    --post301",
  299:    "Do not switch to GET after following a 301"},
  300:   {"    --post302",
  301:    "Do not switch to GET after following a 302"},
  302:   {"    --post303",
  303:    "Do not switch to GET after following a 303"},
  304:   {"    --preproxy [protocol://]host[:port]",
  305:    "Use this proxy first"},
  306:   {"-#, --progress-bar",
  307:    "Display transfer progress as a bar"},
  308:   {"    --proto <protocols>",
  309:    "Enable/disable PROTOCOLS"},
  310:   {"    --proto-default <protocol>",
  311:    "Use PROTOCOL for any URL missing a scheme"},
  312:   {"    --proto-redir <protocols>",
  313:    "Enable/disable PROTOCOLS on redirect"},
  314:   {"-x, --proxy [protocol://]host[:port]",
  315:    "Use this proxy"},
  316:   {"    --proxy-anyauth",
  317:    "Pick any proxy authentication method"},
  318:   {"    --proxy-basic",
  319:    "Use Basic authentication on the proxy"},
  320:   {"    --proxy-cacert <file>",
  321:    "CA certificate to verify peer against for proxy"},
  322:   {"    --proxy-capath <dir>",
  323:    "CA directory to verify peer against for proxy"},
  324:   {"    --proxy-cert <cert[:passwd]>",
  325:    "Set client certificate for proxy"},
  326:   {"    --proxy-cert-type <type>",
  327:    "Client certificate type for HTTPS proxy"},
  328:   {"    --proxy-ciphers <list>",
  329:    "SSL ciphers to use for proxy"},
  330:   {"    --proxy-crlfile <file>",
  331:    "Set a CRL list for proxy"},
  332:   {"    --proxy-digest",
  333:    "Use Digest authentication on the proxy"},
  334:   {"    --proxy-header <header/@file>",
  335:    "Pass custom header(s) to proxy"},
  336:   {"    --proxy-insecure",
  337:    "Do HTTPS proxy connections without verifying the proxy"},
  338:   {"    --proxy-key <key>",
  339:    "Private key for HTTPS proxy"},
  340:   {"    --proxy-key-type <type>",
  341:    "Private key file type for proxy"},
  342:   {"    --proxy-negotiate",
  343:    "Use HTTP Negotiate (SPNEGO) authentication on the proxy"},
  344:   {"    --proxy-ntlm",
  345:    "Use NTLM authentication on the proxy"},
  346:   {"    --proxy-pass <phrase>",
  347:    "Pass phrase for the private key for HTTPS proxy"},
  348:   {"    --proxy-pinnedpubkey <hashes>",
  349:    "FILE/HASHES public key to verify proxy with"},
  350:   {"    --proxy-service-name <name>",
  351:    "SPNEGO proxy service name"},
  352:   {"    --proxy-ssl-allow-beast",
  353:    "Allow security flaw for interop for HTTPS proxy"},
  354:   {"    --proxy-tls13-ciphers <list>",
  355:    "TLS 1.3 ciphersuites for proxy (OpenSSL)"},
  356:   {"    --proxy-tlsauthtype <type>",
  357:    "TLS authentication type for HTTPS proxy"},
  358:   {"    --proxy-tlspassword <string>",
  359:    "TLS password for HTTPS proxy"},
  360:   {"    --proxy-tlsuser <name>",
  361:    "TLS username for HTTPS proxy"},
  362:   {"    --proxy-tlsv1",
  363:    "Use TLSv1 for HTTPS proxy"},
  364:   {"-U, --proxy-user <user:password>",
  365:    "Proxy user and password"},
  366:   {"    --proxy1.0 <host[:port]>",
  367:    "Use HTTP/1.0 proxy on given port"},
  368:   {"-p, --proxytunnel",
  369:    "Operate through an HTTP proxy tunnel (using CONNECT)"},
  370:   {"    --pubkey <key>",
  371:    "SSH Public key file name"},
  372:   {"-Q, --quote",
  373:    "Send command(s) to server before transfer"},
  374:   {"    --random-file <file>",
  375:    "File for reading random data from"},
  376:   {"-r, --range <range>",
  377:    "Retrieve only the bytes within RANGE"},
  378:   {"    --raw",
  379:    "Do HTTP \"raw\"; no transfer decoding"},
  380:   {"-e, --referer <URL>",
  381:    "Referrer URL"},
  382:   {"-J, --remote-header-name",
  383:    "Use the header-provided filename"},
  384:   {"-O, --remote-name",
  385:    "Write output to a file named as the remote file"},
  386:   {"    --remote-name-all",
  387:    "Use the remote file name for all URLs"},
  388:   {"-R, --remote-time",
  389:    "Set the remote file's time on the local output"},
  390:   {"-X, --request <command>",
  391:    "Specify request command to use"},
  392:   {"    --request-target",
  393:    "Specify the target for this request"},
  394:   {"    --resolve <host:port:address[,address]...>",
  395:    "Resolve the host+port to this address"},
  396:   {"    --retry <num>",
  397:    "Retry request if transient problems occur"},
  398:   {"    --retry-connrefused",
  399:    "Retry on connection refused (use with --retry)"},
  400:   {"    --retry-delay <seconds>",
  401:    "Wait time between retries"},
  402:   {"    --retry-max-time <seconds>",
  403:    "Retry only within this period"},
  404:   {"    --sasl-authzid <identity> ",
  405:    "Use this identity to act as during SASL PLAIN authentication"},
  406:   {"    --sasl-ir",
  407:    "Enable initial response in SASL authentication"},
  408:   {"    --service-name <name>",
  409:    "SPNEGO service name"},
  410:   {"-S, --show-error",
  411:    "Show error even when -s is used"},
  412:   {"-s, --silent",
  413:    "Silent mode"},
  414:   {"    --socks4 <host[:port]>",
  415:    "SOCKS4 proxy on given host + port"},
  416:   {"    --socks4a <host[:port]>",
  417:    "SOCKS4a proxy on given host + port"},
  418:   {"    --socks5 <host[:port]>",
  419:    "SOCKS5 proxy on given host + port"},
  420:   {"    --socks5-basic",
  421:    "Enable username/password auth for SOCKS5 proxies"},
  422:   {"    --socks5-gssapi",
  423:    "Enable GSS-API auth for SOCKS5 proxies"},
  424:   {"    --socks5-gssapi-nec",
  425:    "Compatibility with NEC SOCKS5 server"},
  426:   {"    --socks5-gssapi-service <name>",
  427:    "SOCKS5 proxy service name for GSS-API"},
  428:   {"    --socks5-hostname <host[:port]>",
  429:    "SOCKS5 proxy, pass host name to proxy"},
  430:   {"-Y, --speed-limit <speed>",
  431:    "Stop transfers slower than this"},
  432:   {"-y, --speed-time <seconds>",
  433:    "Trigger 'speed-limit' abort after this time"},
  434:   {"    --ssl",
  435:    "Try SSL/TLS"},
  436:   {"    --ssl-allow-beast",
  437:    "Allow security flaw to improve interop"},
  438:   {"    --ssl-no-revoke",
  439:    "Disable cert revocation checks (Schannel)"},
  440:   {"    --ssl-revoke-best-effort",
  441:    "Ignore revocation offline or missing revocation list errors (Schannel)"},
  442:   {"    --ssl-reqd",
  443:    "Require SSL/TLS"},
  444:   {"-2, --sslv2",
  445:    "Use SSLv2"},
  446:   {"-3, --sslv3",
  447:    "Use SSLv3"},
  448:   {"    --stderr",
  449:    "Where to redirect stderr"},
  450:   {"    --styled-output",
  451:    "Enable styled output for HTTP headers"},
  452:   {"    --suppress-connect-headers",
  453:    "Suppress proxy CONNECT response headers"},
  454:   {"    --tcp-fastopen",
  455:    "Use TCP Fast Open"},
  456:   {"    --tcp-nodelay",
  457:    "Use the TCP_NODELAY option"},
  458:   {"-t, --telnet-option <opt=val>",
  459:    "Set telnet option"},
  460:   {"    --tftp-blksize <value>",
  461:    "Set TFTP BLKSIZE option"},
  462:   {"    --tftp-no-options",
  463:    "Do not send any TFTP options"},
  464:   {"-z, --time-cond <time>",
  465:    "Transfer based on a time condition"},
  466:   {"    --tls-max <VERSION>",
  467:    "Set maximum allowed TLS version"},
  468:   {"    --tls13-ciphers <list>",
  469:    "TLS 1.3 ciphersuites (OpenSSL)"},
  470:   {"    --tlsauthtype <type>",
  471:    "TLS authentication type"},
  472:   {"    --tlspassword",
  473:    "TLS password"},
  474:   {"    --tlsuser <name>",
  475:    "TLS user name"},
  476:   {"-1, --tlsv1",
  477:    "Use TLSv1.0 or greater"},
  478:   {"    --tlsv1.0",
  479:    "Use TLSv1.0 or greater"},
  480:   {"    --tlsv1.1",
  481:    "Use TLSv1.1 or greater"},
  482:   {"    --tlsv1.2",
  483:    "Use TLSv1.2 or greater"},
  484:   {"    --tlsv1.3",
  485:    "Use TLSv1.3 or greater"},
  486:   {"    --tr-encoding",
  487:    "Request compressed transfer encoding"},
  488:   {"    --trace <file>",
  489:    "Write a debug trace to FILE"},
  490:   {"    --trace-ascii <file>",
  491:    "Like --trace, but without hex output"},
  492:   {"    --trace-time",
  493:    "Add time stamps to trace/verbose output"},
  494:   {"    --unix-socket <path>",
  495:    "Connect through this Unix domain socket"},
  496:   {"-T, --upload-file <file>",
  497:    "Transfer local FILE to destination"},
  498:   {"    --url <url>",
  499:    "URL to work with"},
  500:   {"-B, --use-ascii",
  501:    "Use ASCII/text transfer"},
  502:   {"-u, --user <user:password>",
  503:    "Server user and password"},
  504:   {"-A, --user-agent <name>",
  505:    "Send User-Agent <name> to server"},
  506:   {"-v, --verbose",
  507:    "Make the operation more talkative"},
  508:   {"-V, --version",
  509:    "Show version number and quit"},
  510:   {"-w, --write-out <format>",
  511:    "Use output FORMAT after completion"},
  512:   {"    --xattr",
  513:    "Store metadata in extended file attributes"},
  514:   { NULL, NULL }
  515: };
  516: 
  517: #ifdef NETWARE
  518: #  define PRINT_LINES_PAUSE 23
  519: #endif
  520: 
  521: #ifdef __SYMBIAN32__
  522: #  define PRINT_LINES_PAUSE 16
  523: #endif
  524: 
  525: struct feat {
  526:   const char *name;
  527:   int bitmask;
  528: };
  529: 
  530: static const struct feat feats[] = {
  531:   {"AsynchDNS",      CURL_VERSION_ASYNCHDNS},
  532:   {"Debug",          CURL_VERSION_DEBUG},
  533:   {"TrackMemory",    CURL_VERSION_CURLDEBUG},
  534:   {"IDN",            CURL_VERSION_IDN},
  535:   {"IPv6",           CURL_VERSION_IPV6},
  536:   {"Largefile",      CURL_VERSION_LARGEFILE},
  537:   {"SSPI",           CURL_VERSION_SSPI},
  538:   {"GSS-API",        CURL_VERSION_GSSAPI},
  539:   {"Kerberos",       CURL_VERSION_KERBEROS5},
  540:   {"SPNEGO",         CURL_VERSION_SPNEGO},
  541:   {"NTLM",           CURL_VERSION_NTLM},
  542:   {"NTLM_WB",        CURL_VERSION_NTLM_WB},
  543:   {"SSL",            CURL_VERSION_SSL},
  544:   {"libz",           CURL_VERSION_LIBZ},
  545:   {"brotli",         CURL_VERSION_BROTLI},
  546:   {"CharConv",       CURL_VERSION_CONV},
  547:   {"TLS-SRP",        CURL_VERSION_TLSAUTH_SRP},
  548:   {"HTTP2",          CURL_VERSION_HTTP2},
  549:   {"HTTP3",          CURL_VERSION_HTTP3},
  550:   {"UnixSockets",    CURL_VERSION_UNIX_SOCKETS},
  551:   {"HTTPS-proxy",    CURL_VERSION_HTTPS_PROXY},
  552:   {"MultiSSL",       CURL_VERSION_MULTI_SSL},
  553:   {"PSL",            CURL_VERSION_PSL},
  554:   {"alt-svc",        CURL_VERSION_ALTSVC},
  555: };
  556: 
  557: void tool_help(void)
  558: {
  559:   int i;
  560:   puts("Usage: curl [options...] <url>");
  561:   for(i = 0; helptext[i].opt; i++) {
  562:     printf(" %-19s %s\n", helptext[i].opt, helptext[i].desc);
  563: #ifdef PRINT_LINES_PAUSE
  564:     if(i && ((i % PRINT_LINES_PAUSE) == 0))
  565:       tool_pressanykey();
  566: #endif
  567:   }
  568: }
  569: 
  570: static int
  571: featcomp(const void *p1, const void *p2)
  572: {
  573:   /* The arguments to this function are "pointers to pointers to char", but
  574:      the comparison arguments are "pointers to char", hence the following cast
  575:      plus dereference */
  576: #ifdef HAVE_STRCASECMP
  577:   return strcasecmp(* (char * const *) p1, * (char * const *) p2);
  578: #elif defined(HAVE_STRCMPI)
  579:   return strcmpi(* (char * const *) p1, * (char * const *) p2);
  580: #else
  581:   return strcmp(* (char * const *) p1, * (char * const *) p2);
  582: #endif
  583: }
  584: 
  585: void tool_version_info(void)
  586: {
  587:   const char *const *proto;
  588: 
  589:   printf(CURL_ID "%s\n", curl_version());
  590: #ifdef CURL_PATCHSTAMP
  591:   printf("Release-Date: %s, security patched: %s\n",
  592:          LIBCURL_TIMESTAMP, CURL_PATCHSTAMP);
  593: #else
  594:   printf("Release-Date: %s\n", LIBCURL_TIMESTAMP);
  595: #endif
  596:   if(curlinfo->protocols) {
  597:     printf("Protocols: ");
  598:     for(proto = curlinfo->protocols; *proto; ++proto) {
  599:       printf("%s ", *proto);
  600:     }
  601:     puts(""); /* newline */
  602:   }
  603:   if(curlinfo->features) {
  604:     char *featp[ sizeof(feats) / sizeof(feats[0]) + 1];
  605:     size_t numfeat = 0;
  606:     unsigned int i;
  607:     printf("Features:");
  608:     for(i = 0; i < sizeof(feats)/sizeof(feats[0]); i++) {
  609:       if(curlinfo->features & feats[i].bitmask)
  610:         featp[numfeat++] = (char *)feats[i].name;
  611:     }
  612: #ifdef USE_METALINK
  613:     featp[numfeat++] = (char *)"Metalink";
  614: #endif
  615:     qsort(&featp[0], numfeat, sizeof(char *), featcomp);
  616:     for(i = 0; i< numfeat; i++)
  617:       printf(" %s", featp[i]);
  618:     puts(""); /* newline */
  619:   }
  620:   if(strcmp(CURL_VERSION, curlinfo->version)) {
  621:     printf("WARNING: curl and libcurl versions do not match. "
  622:            "Functionality may be affected.\n");
  623:   }
  624: }
  625: 
  626: void tool_list_engines(void)
  627: {
  628:   CURL *curl = curl_easy_init();
  629:   struct curl_slist *engines = NULL;
  630: 
  631:   /* Get the list of engines */
  632:   curl_easy_getinfo(curl, CURLINFO_SSL_ENGINES, &engines);
  633: 
  634:   puts("Build-time engines:");
  635:   if(engines) {
  636:     for(; engines; engines = engines->next)
  637:       printf("  %s\n", engines->data);
  638:   }
  639:   else {
  640:     puts("  <none>");
  641:   }
  642: 
  643:   /* Cleanup the list of engines */
  644:   curl_slist_free_all(engines);
  645:   curl_easy_cleanup(curl);
  646: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>