Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/curl/src/tool_help.c @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 1 /*************************************************************************** | |
| 2 * _ _ ____ _ | |
| 3 * Project ___| | | | _ \| | | |
| 4 * / __| | | | |_) | | | |
| 5 * | (__| |_| | _ <| |___ | |
| 6 * \___|\___/|_| \_\_____| | |
| 7 * | |
| 8 * Copyright (C) 1998 - 2019, 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 | |
| 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 {" --expect100-timeout <seconds>", | |
| 135 "How long to wait for 100-continue"}, | |
| 136 {"-f, --fail", | |
| 137 "Fail silently (no output at all) on HTTP errors"}, | |
| 138 {" --fail-early", | |
| 139 "Fail on first transfer error, do not continue"}, | |
| 140 {" --false-start", | |
| 141 "Enable TLS False Start"}, | |
| 142 {"-F, --form <name=content>", | |
| 143 "Specify multipart MIME data"}, | |
| 144 {" --form-string <name=string>", | |
| 145 "Specify multipart MIME data"}, | |
| 146 {" --ftp-account <data>", | |
| 147 "Account data string"}, | |
| 148 {" --ftp-alternative-to-user <command>", | |
| 149 "String to replace USER [name]"}, | |
| 150 {" --ftp-create-dirs", | |
| 151 "Create the remote dirs if not present"}, | |
| 152 {" --ftp-method <method>", | |
| 153 "Control CWD usage"}, | |
| 154 {" --ftp-pasv", | |
| 155 "Use PASV/EPSV instead of PORT"}, | |
| 156 {"-P, --ftp-port <address>", | |
| 157 "Use PORT instead of PASV"}, | |
| 158 {" --ftp-pret", | |
| 159 "Send PRET before PASV"}, | |
| 160 {" --ftp-skip-pasv-ip", | |
| 161 "Skip the IP address for PASV"}, | |
| 162 {" --ftp-ssl-ccc", | |
| 163 "Send CCC after authenticating"}, | |
| 164 {" --ftp-ssl-ccc-mode <active/passive>", | |
| 165 "Set CCC mode"}, | |
| 166 {" --ftp-ssl-control", | |
| 167 "Require SSL/TLS for FTP login, clear for transfer"}, | |
| 168 {"-G, --get", | |
| 169 "Put the post data in the URL and use GET"}, | |
| 170 {"-g, --globoff", | |
| 171 "Disable URL sequences and ranges using {} and []"}, | |
| 172 {" --happy-eyeballs-timeout-ms <milliseconds>", | |
| 173 "How long to wait in milliseconds for IPv6 before trying IPv4"}, | |
| 174 {" --haproxy-protocol", | |
| 175 "Send HAProxy PROXY protocol v1 header"}, | |
| 176 {"-I, --head", | |
| 177 "Show document info only"}, | |
| 178 {"-H, --header <header/@file>", | |
| 179 "Pass custom header(s) to server"}, | |
| 180 {"-h, --help", | |
| 181 "This help text"}, | |
| 182 {" --hostpubmd5 <md5>", | |
| 183 "Acceptable MD5 hash of the host public key"}, | |
| 184 {" --http0.9", | |
| 185 "Allow HTTP 0.9 responses"}, | |
| 186 {"-0, --http1.0", | |
| 187 "Use HTTP 1.0"}, | |
| 188 {" --http1.1", | |
| 189 "Use HTTP 1.1"}, | |
| 190 {" --http2", | |
| 191 "Use HTTP 2"}, | |
| 192 {" --http2-prior-knowledge", | |
| 193 "Use HTTP 2 without HTTP/1.1 Upgrade"}, | |
| 194 {" --http3", | |
| 195 "Use HTTP v3"}, | |
| 196 {" --ignore-content-length", | |
| 197 "Ignore the size of the remote resource"}, | |
| 198 {"-i, --include", | |
| 199 "Include protocol response headers in the output"}, | |
| 200 {"-k, --insecure", | |
| 201 "Allow insecure server connections when using SSL"}, | |
| 202 {" --interface <name>", | |
| 203 "Use network INTERFACE (or address)"}, | |
| 204 {"-4, --ipv4", | |
| 205 "Resolve names to IPv4 addresses"}, | |
| 206 {"-6, --ipv6", | |
| 207 "Resolve names to IPv6 addresses"}, | |
| 208 {"-j, --junk-session-cookies", | |
| 209 "Ignore session cookies read from file"}, | |
| 210 {" --keepalive-time <seconds>", | |
| 211 "Interval time for keepalive probes"}, | |
| 212 {" --key <key>", | |
| 213 "Private key file name"}, | |
| 214 {" --key-type <type>", | |
| 215 "Private key file type (DER/PEM/ENG)"}, | |
| 216 {" --krb <level>", | |
| 217 "Enable Kerberos with security <level>"}, | |
| 218 {" --libcurl <file>", | |
| 219 "Dump libcurl equivalent code of this command line"}, | |
| 220 {" --limit-rate <speed>", | |
| 221 "Limit transfer speed to RATE"}, | |
| 222 {"-l, --list-only", | |
| 223 "List only mode"}, | |
| 224 {" --local-port <num/range>", | |
| 225 "Force use of RANGE for local port numbers"}, | |
| 226 {"-L, --location", | |
| 227 "Follow redirects"}, | |
| 228 {" --location-trusted", | |
| 229 "Like --location, and send auth to other hosts"}, | |
| 230 {" --login-options <options>", | |
| 231 "Server login options"}, | |
| 232 {" --mail-auth <address>", | |
| 233 "Originator address of the original email"}, | |
| 234 {" --mail-from <address>", | |
| 235 "Mail from this address"}, | |
| 236 {" --mail-rcpt <address>", | |
| 237 "Mail to this address"}, | |
| 238 {"-M, --manual", | |
| 239 "Display the full manual"}, | |
| 240 {" --max-filesize <bytes>", | |
| 241 "Maximum file size to download"}, | |
| 242 {" --max-redirs <num>", | |
| 243 "Maximum number of redirects allowed"}, | |
| 244 {"-m, --max-time <seconds>", | |
| 245 "Maximum time allowed for the transfer"}, | |
| 246 {" --metalink", | |
| 247 "Process given URLs as metalink XML file"}, | |
| 248 {" --negotiate", | |
| 249 "Use HTTP Negotiate (SPNEGO) authentication"}, | |
| 250 {"-n, --netrc", | |
| 251 "Must read .netrc for user name and password"}, | |
| 252 {" --netrc-file <filename>", | |
| 253 "Specify FILE for netrc"}, | |
| 254 {" --netrc-optional", | |
| 255 "Use either .netrc or URL"}, | |
| 256 {"-:, --next", | |
| 257 "Make next URL use its separate set of options"}, | |
| 258 {" --no-alpn", | |
| 259 "Disable the ALPN TLS extension"}, | |
| 260 {"-N, --no-buffer", | |
| 261 "Disable buffering of the output stream"}, | |
| 262 {" --no-keepalive", | |
| 263 "Disable TCP keepalive on the connection"}, | |
| 264 {" --no-npn", | |
| 265 "Disable the NPN TLS extension"}, | |
| 266 {" --no-sessionid", | |
| 267 "Disable SSL session-ID reusing"}, | |
| 268 {" --noproxy <no-proxy-list>", | |
| 269 "List of hosts which do not use proxy"}, | |
| 270 {" --ntlm", | |
| 271 "Use HTTP NTLM authentication"}, | |
| 272 {" --ntlm-wb", | |
| 273 "Use HTTP NTLM authentication with winbind"}, | |
| 274 {" --oauth2-bearer <token>", | |
| 275 "OAuth 2 Bearer Token"}, | |
| 276 {"-o, --output <file>", | |
| 277 "Write to file instead of stdout"}, | |
| 278 {"-Z, --parallel", | |
| 279 "Perform transfers in parallel"}, | |
| 280 {" --parallel-max", | |
| 281 "Maximum concurrency for parallel transfers"}, | |
| 282 {" --pass <phrase>", | |
| 283 "Pass phrase for the private key"}, | |
| 284 {" --path-as-is", | |
| 285 "Do not squash .. sequences in URL path"}, | |
| 286 {" --pinnedpubkey <hashes>", | |
| 287 "FILE/HASHES Public key to verify peer against"}, | |
| 288 {" --post301", | |
| 289 "Do not switch to GET after following a 301"}, | |
| 290 {" --post302", | |
| 291 "Do not switch to GET after following a 302"}, | |
| 292 {" --post303", | |
| 293 "Do not switch to GET after following a 303"}, | |
| 294 {" --preproxy [protocol://]host[:port]", | |
| 295 "Use this proxy first"}, | |
| 296 {"-#, --progress-bar", | |
| 297 "Display transfer progress as a bar"}, | |
| 298 {" --proto <protocols>", | |
| 299 "Enable/disable PROTOCOLS"}, | |
| 300 {" --proto-default <protocol>", | |
| 301 "Use PROTOCOL for any URL missing a scheme"}, | |
| 302 {" --proto-redir <protocols>", | |
| 303 "Enable/disable PROTOCOLS on redirect"}, | |
| 304 {"-x, --proxy [protocol://]host[:port]", | |
| 305 "Use this proxy"}, | |
| 306 {" --proxy-anyauth", | |
| 307 "Pick any proxy authentication method"}, | |
| 308 {" --proxy-basic", | |
| 309 "Use Basic authentication on the proxy"}, | |
| 310 {" --proxy-cacert <file>", | |
| 311 "CA certificate to verify peer against for proxy"}, | |
| 312 {" --proxy-capath <dir>", | |
| 313 "CA directory to verify peer against for proxy"}, | |
| 314 {" --proxy-cert <cert[:passwd]>", | |
| 315 "Set client certificate for proxy"}, | |
| 316 {" --proxy-cert-type <type>", | |
| 317 "Client certificate type for HTTPS proxy"}, | |
| 318 {" --proxy-ciphers <list>", | |
| 319 "SSL ciphers to use for proxy"}, | |
| 320 {" --proxy-crlfile <file>", | |
| 321 "Set a CRL list for proxy"}, | |
| 322 {" --proxy-digest", | |
| 323 "Use Digest authentication on the proxy"}, | |
| 324 {" --proxy-header <header/@file>", | |
| 325 "Pass custom header(s) to proxy"}, | |
| 326 {" --proxy-insecure", | |
| 327 "Do HTTPS proxy connections without verifying the proxy"}, | |
| 328 {" --proxy-key <key>", | |
| 329 "Private key for HTTPS proxy"}, | |
| 330 {" --proxy-key-type <type>", | |
| 331 "Private key file type for proxy"}, | |
| 332 {" --proxy-negotiate", | |
| 333 "Use HTTP Negotiate (SPNEGO) authentication on the proxy"}, | |
| 334 {" --proxy-ntlm", | |
| 335 "Use NTLM authentication on the proxy"}, | |
| 336 {" --proxy-pass <phrase>", | |
| 337 "Pass phrase for the private key for HTTPS proxy"}, | |
| 338 {" --proxy-pinnedpubkey <hashes>", | |
| 339 "FILE/HASHES public key to verify proxy with"}, | |
| 340 {" --proxy-service-name <name>", | |
| 341 "SPNEGO proxy service name"}, | |
| 342 {" --proxy-ssl-allow-beast", | |
| 343 "Allow security flaw for interop for HTTPS proxy"}, | |
| 344 {" --proxy-tls13-ciphers <list>", | |
| 345 "TLS 1.3 ciphersuites for proxy (OpenSSL)"}, | |
| 346 {" --proxy-tlsauthtype <type>", | |
| 347 "TLS authentication type for HTTPS proxy"}, | |
| 348 {" --proxy-tlspassword <string>", | |
| 349 "TLS password for HTTPS proxy"}, | |
| 350 {" --proxy-tlsuser <name>", | |
| 351 "TLS username for HTTPS proxy"}, | |
| 352 {" --proxy-tlsv1", | |
| 353 "Use TLSv1 for HTTPS proxy"}, | |
| 354 {"-U, --proxy-user <user:password>", | |
| 355 "Proxy user and password"}, | |
| 356 {" --proxy1.0 <host[:port]>", | |
| 357 "Use HTTP/1.0 proxy on given port"}, | |
| 358 {"-p, --proxytunnel", | |
| 359 "Operate through an HTTP proxy tunnel (using CONNECT)"}, | |
| 360 {" --pubkey <key>", | |
| 361 "SSH Public key file name"}, | |
| 362 {"-Q, --quote", | |
| 363 "Send command(s) to server before transfer"}, | |
| 364 {" --random-file <file>", | |
| 365 "File for reading random data from"}, | |
| 366 {"-r, --range <range>", | |
| 367 "Retrieve only the bytes within RANGE"}, | |
| 368 {" --raw", | |
| 369 "Do HTTP \"raw\"; no transfer decoding"}, | |
| 370 {"-e, --referer <URL>", | |
| 371 "Referrer URL"}, | |
| 372 {"-J, --remote-header-name", | |
| 373 "Use the header-provided filename"}, | |
| 374 {"-O, --remote-name", | |
| 375 "Write output to a file named as the remote file"}, | |
| 376 {" --remote-name-all", | |
| 377 "Use the remote file name for all URLs"}, | |
| 378 {"-R, --remote-time", | |
| 379 "Set the remote file's time on the local output"}, | |
| 380 {"-X, --request <command>", | |
| 381 "Specify request command to use"}, | |
| 382 {" --request-target", | |
| 383 "Specify the target for this request"}, | |
| 384 {" --resolve <host:port:address[,address]...>", | |
| 385 "Resolve the host+port to this address"}, | |
| 386 {" --retry <num>", | |
| 387 "Retry request if transient problems occur"}, | |
| 388 {" --retry-connrefused", | |
| 389 "Retry on connection refused (use with --retry)"}, | |
| 390 {" --retry-delay <seconds>", | |
| 391 "Wait time between retries"}, | |
| 392 {" --retry-max-time <seconds>", | |
| 393 "Retry only within this period"}, | |
| 394 {" --sasl-authzid <identity> ", | |
| 395 "Use this identity to act as during SASL PLAIN authentication"}, | |
| 396 {" --sasl-ir", | |
| 397 "Enable initial response in SASL authentication"}, | |
| 398 {" --service-name <name>", | |
| 399 "SPNEGO service name"}, | |
| 400 {"-S, --show-error", | |
| 401 "Show error even when -s is used"}, | |
| 402 {"-s, --silent", | |
| 403 "Silent mode"}, | |
| 404 {" --socks4 <host[:port]>", | |
| 405 "SOCKS4 proxy on given host + port"}, | |
| 406 {" --socks4a <host[:port]>", | |
| 407 "SOCKS4a proxy on given host + port"}, | |
| 408 {" --socks5 <host[:port]>", | |
| 409 "SOCKS5 proxy on given host + port"}, | |
| 410 {" --socks5-basic", | |
| 411 "Enable username/password auth for SOCKS5 proxies"}, | |
| 412 {" --socks5-gssapi", | |
| 413 "Enable GSS-API auth for SOCKS5 proxies"}, | |
| 414 {" --socks5-gssapi-nec", | |
| 415 "Compatibility with NEC SOCKS5 server"}, | |
| 416 {" --socks5-gssapi-service <name>", | |
| 417 "SOCKS5 proxy service name for GSS-API"}, | |
| 418 {" --socks5-hostname <host[:port]>", | |
| 419 "SOCKS5 proxy, pass host name to proxy"}, | |
| 420 {"-Y, --speed-limit <speed>", | |
| 421 "Stop transfers slower than this"}, | |
| 422 {"-y, --speed-time <seconds>", | |
| 423 "Trigger 'speed-limit' abort after this time"}, | |
| 424 {" --ssl", | |
| 425 "Try SSL/TLS"}, | |
| 426 {" --ssl-allow-beast", | |
| 427 "Allow security flaw to improve interop"}, | |
| 428 {" --ssl-no-revoke", | |
| 429 "Disable cert revocation checks (Schannel)"}, | |
| 430 {" --ssl-reqd", | |
| 431 "Require SSL/TLS"}, | |
| 432 {"-2, --sslv2", | |
| 433 "Use SSLv2"}, | |
| 434 {"-3, --sslv3", | |
| 435 "Use SSLv3"}, | |
| 436 {" --stderr", | |
| 437 "Where to redirect stderr"}, | |
| 438 {" --styled-output", | |
| 439 "Enable styled output for HTTP headers"}, | |
| 440 {" --suppress-connect-headers", | |
| 441 "Suppress proxy CONNECT response headers"}, | |
| 442 {" --tcp-fastopen", | |
| 443 "Use TCP Fast Open"}, | |
| 444 {" --tcp-nodelay", | |
| 445 "Use the TCP_NODELAY option"}, | |
| 446 {"-t, --telnet-option <opt=val>", | |
| 447 "Set telnet option"}, | |
| 448 {" --tftp-blksize <value>", | |
| 449 "Set TFTP BLKSIZE option"}, | |
| 450 {" --tftp-no-options", | |
| 451 "Do not send any TFTP options"}, | |
| 452 {"-z, --time-cond <time>", | |
| 453 "Transfer based on a time condition"}, | |
| 454 {" --tls-max <VERSION>", | |
| 455 "Set maximum allowed TLS version"}, | |
| 456 {" --tls13-ciphers <list>", | |
| 457 "TLS 1.3 ciphersuites (OpenSSL)"}, | |
| 458 {" --tlsauthtype <type>", | |
| 459 "TLS authentication type"}, | |
| 460 {" --tlspassword", | |
| 461 "TLS password"}, | |
| 462 {" --tlsuser <name>", | |
| 463 "TLS user name"}, | |
| 464 {"-1, --tlsv1", | |
| 465 "Use TLSv1.0 or greater"}, | |
| 466 {" --tlsv1.0", | |
| 467 "Use TLSv1.0 or greater"}, | |
| 468 {" --tlsv1.1", | |
| 469 "Use TLSv1.1 or greater"}, | |
| 470 {" --tlsv1.2", | |
| 471 "Use TLSv1.2 or greater"}, | |
| 472 {" --tlsv1.3", | |
| 473 "Use TLSv1.3 or greater"}, | |
| 474 {" --tr-encoding", | |
| 475 "Request compressed transfer encoding"}, | |
| 476 {" --trace <file>", | |
| 477 "Write a debug trace to FILE"}, | |
| 478 {" --trace-ascii <file>", | |
| 479 "Like --trace, but without hex output"}, | |
| 480 {" --trace-time", | |
| 481 "Add time stamps to trace/verbose output"}, | |
| 482 {" --unix-socket <path>", | |
| 483 "Connect through this Unix domain socket"}, | |
| 484 {"-T, --upload-file <file>", | |
| 485 "Transfer local FILE to destination"}, | |
| 486 {" --url <url>", | |
| 487 "URL to work with"}, | |
| 488 {"-B, --use-ascii", | |
| 489 "Use ASCII/text transfer"}, | |
| 490 {"-u, --user <user:password>", | |
| 491 "Server user and password"}, | |
| 492 {"-A, --user-agent <name>", | |
| 493 "Send User-Agent <name> to server"}, | |
| 494 {"-v, --verbose", | |
| 495 "Make the operation more talkative"}, | |
| 496 {"-V, --version", | |
| 497 "Show version number and quit"}, | |
| 498 {"-w, --write-out <format>", | |
| 499 "Use output FORMAT after completion"}, | |
| 500 {" --xattr", | |
| 501 "Store metadata in extended file attributes"}, | |
| 502 { NULL, NULL } | |
| 503 }; | |
| 504 | |
| 505 #ifdef NETWARE | |
| 506 # define PRINT_LINES_PAUSE 23 | |
| 507 #endif | |
| 508 | |
| 509 #ifdef __SYMBIAN32__ | |
| 510 # define PRINT_LINES_PAUSE 16 | |
| 511 #endif | |
| 512 | |
| 513 struct feat { | |
| 514 const char *name; | |
| 515 int bitmask; | |
| 516 }; | |
| 517 | |
| 518 static const struct feat feats[] = { | |
| 519 {"AsynchDNS", CURL_VERSION_ASYNCHDNS}, | |
| 520 {"Debug", CURL_VERSION_DEBUG}, | |
| 521 {"TrackMemory", CURL_VERSION_CURLDEBUG}, | |
| 522 {"IDN", CURL_VERSION_IDN}, | |
| 523 {"IPv6", CURL_VERSION_IPV6}, | |
| 524 {"Largefile", CURL_VERSION_LARGEFILE}, | |
| 525 {"SSPI", CURL_VERSION_SSPI}, | |
| 526 {"GSS-API", CURL_VERSION_GSSAPI}, | |
| 527 {"Kerberos", CURL_VERSION_KERBEROS5}, | |
| 528 {"SPNEGO", CURL_VERSION_SPNEGO}, | |
| 529 {"NTLM", CURL_VERSION_NTLM}, | |
| 530 {"NTLM_WB", CURL_VERSION_NTLM_WB}, | |
| 531 {"SSL", CURL_VERSION_SSL}, | |
| 532 {"libz", CURL_VERSION_LIBZ}, | |
| 533 {"brotli", CURL_VERSION_BROTLI}, | |
| 534 {"CharConv", CURL_VERSION_CONV}, | |
| 535 {"TLS-SRP", CURL_VERSION_TLSAUTH_SRP}, | |
| 536 {"HTTP2", CURL_VERSION_HTTP2}, | |
| 537 {"HTTP3", CURL_VERSION_HTTP3}, | |
| 538 {"UnixSockets", CURL_VERSION_UNIX_SOCKETS}, | |
| 539 {"HTTPS-proxy", CURL_VERSION_HTTPS_PROXY}, | |
| 540 {"MultiSSL", CURL_VERSION_MULTI_SSL}, | |
| 541 {"PSL", CURL_VERSION_PSL}, | |
| 542 {"alt-svc", CURL_VERSION_ALTSVC}, | |
| 543 }; | |
| 544 | |
| 545 void tool_help(void) | |
| 546 { | |
| 547 int i; | |
| 548 puts("Usage: curl [options...] <url>"); | |
| 549 for(i = 0; helptext[i].opt; i++) { | |
| 550 printf(" %-19s %s\n", helptext[i].opt, helptext[i].desc); | |
| 551 #ifdef PRINT_LINES_PAUSE | |
| 552 if(i && ((i % PRINT_LINES_PAUSE) == 0)) | |
| 553 tool_pressanykey(); | |
| 554 #endif | |
| 555 } | |
| 556 } | |
| 557 | |
| 558 static int | |
| 559 featcomp(const void *p1, const void *p2) | |
| 560 { | |
| 561 /* The arguments to this function are "pointers to pointers to char", but | |
| 562 the comparison arguments are "pointers to char", hence the following cast | |
| 563 plus dereference */ | |
| 564 #ifdef HAVE_STRCASECMP | |
| 565 return strcasecmp(* (char * const *) p1, * (char * const *) p2); | |
| 566 #elif defined(HAVE_STRCMPI) | |
| 567 return strcmpi(* (char * const *) p1, * (char * const *) p2); | |
| 568 #else | |
| 569 return strcmp(* (char * const *) p1, * (char * const *) p2); | |
| 570 #endif | |
| 571 } | |
| 572 | |
| 573 void tool_version_info(void) | |
| 574 { | |
| 575 const char *const *proto; | |
| 576 | |
| 577 printf(CURL_ID "%s\n", curl_version()); | |
| 578 #ifdef CURL_PATCHSTAMP | |
| 579 printf("Release-Date: %s, security patched: %s\n", | |
| 580 LIBCURL_TIMESTAMP, CURL_PATCHSTAMP); | |
| 581 #else | |
| 582 printf("Release-Date: %s\n", LIBCURL_TIMESTAMP); | |
| 583 #endif | |
| 584 if(curlinfo->protocols) { | |
| 585 printf("Protocols: "); | |
| 586 for(proto = curlinfo->protocols; *proto; ++proto) { | |
| 587 printf("%s ", *proto); | |
| 588 } | |
| 589 puts(""); /* newline */ | |
| 590 } | |
| 591 if(curlinfo->features) { | |
| 592 char *featp[ sizeof(feats) / sizeof(feats[0]) + 1]; | |
| 593 size_t numfeat = 0; | |
| 594 unsigned int i; | |
| 595 printf("Features:"); | |
| 596 for(i = 0; i < sizeof(feats)/sizeof(feats[0]); i++) { | |
| 597 if(curlinfo->features & feats[i].bitmask) | |
| 598 featp[numfeat++] = (char *)feats[i].name; | |
| 599 } | |
| 600 #ifdef USE_METALINK | |
| 601 featp[numfeat++] = (char *)"Metalink"; | |
| 602 #endif | |
| 603 qsort(&featp[0], numfeat, sizeof(char *), featcomp); | |
| 604 for(i = 0; i< numfeat; i++) | |
| 605 printf(" %s", featp[i]); | |
| 606 puts(""); /* newline */ | |
| 607 } | |
| 608 if(strcmp(CURL_VERSION, curlinfo->version)) { | |
| 609 printf("WARNING: curl and libcurl versions do not match. " | |
| 610 "Functionality may be affected.\n"); | |
| 611 } | |
| 612 } | |
| 613 | |
| 614 void tool_list_engines(void) | |
| 615 { | |
| 616 CURL *curl = curl_easy_init(); | |
| 617 struct curl_slist *engines = NULL; | |
| 618 | |
| 619 /* Get the list of engines */ | |
| 620 curl_easy_getinfo(curl, CURLINFO_SSL_ENGINES, &engines); | |
| 621 | |
| 622 puts("Build-time engines:"); | |
| 623 if(engines) { | |
| 624 for(; engines; engines = engines->next) | |
| 625 printf(" %s\n", engines->data); | |
| 626 } | |
| 627 else { | |
| 628 puts(" <none>"); | |
| 629 } | |
| 630 | |
| 631 /* Cleanup the list of engines */ | |
| 632 curl_slist_free_all(engines); | |
| 633 curl_easy_cleanup(curl); | |
| 634 } |
