curl: generate the --help output

... using the docs/cmdline-opts/gen.pl script, so that we get all the
command line option documentation from the same source.

The generation of the list has to be done manually and pasted into the
source code.

Closes #1465
This commit is contained in:
Daniel Stenberg 2017-05-08 23:30:29 +02:00
parent 73afcfc0ae
commit 8b2f22ed29
3 changed files with 435 additions and 253 deletions

View File

@ -307,10 +307,12 @@ sub listhelp {
if($arg) { if($arg) {
$opt .= " $arg"; $opt .= " $arg";
} }
my $desc = $helplong{$f};
$desc =~ s/\"/\\\"/g; # escape double quotes
my $line = sprintf " %-19s %s\n", $opt, $helplong{$f}; my $line = sprintf " {\"%s\",\n \"%s\"},\n", $opt, $desc;
if(length($line) > 79) { if(length($opt) + length($desc) > 78) {
print STDERR "WARN: the --$long line is too long\n"; print STDERR "WARN: the --$long line is too long\n";
} }
print $line; print $line;

View File

@ -33,255 +33,434 @@
#endif #endif
/* /*
* A few of these source lines are >80 columns wide, but that's only because * The help output is generated with the following command
* breaking the strings narrower makes this chunk look even worse! ---------------------------------------------------------
*
* Starting with 7.18.0, this list of command line options is sorted based cd $srcroot/docs/cmdline-opts
* on the long option name. It is not done automatically, although a command ./gen.pl listhelp
* line like the following can help out:
*
* curl --help | cut -c5- | grep "^-" | sort
*/ */
static const char *const helptext[] = { struct helptxt {
"Usage: curl [options...] <url>", const char *opt;
"Options: (H) means HTTP/HTTPS only, (F) means FTP only", const char *desc;
" --anyauth Pick \"any\" authentication method (H)", };
" -a, --append Append to target file when uploading (F/SFTP)",
" --basic Use HTTP Basic Authentication (H)", static const struct helptxt helptext[] = {
" --cacert FILE CA certificate to verify peer against (SSL)", {" --abstract-unix-socket <path>",
" --capath DIR CA directory to verify peer against (SSL)", "Connect via abstract Unix domain socket"},
" -E, --cert CERT[:PASSWD] Client certificate file and password (SSL)", {" --anyauth",
" --cert-status Verify the status of the server certificate (SSL)", "Pick any authentication method"},
" --cert-type TYPE Certificate file type (DER/PEM/ENG) (SSL)", {"-a, --append",
" --ciphers LIST SSL ciphers to use (SSL)", "Append to target file when uploading"},
" --compressed Request compressed response (using deflate or gzip)", {" --basic",
" -K, --config FILE Read config from FILE", "Use HTTP Basic Authentication"},
" --connect-timeout SECONDS Maximum time allowed for connection", {" --cacert <CA certificate>",
" --connect-to HOST1:PORT1:HOST2:PORT2 Connect to host (network level)", "CA certificate to verify peer against"},
" -C, --continue-at OFFSET Resumed transfer OFFSET", {" --capath <dir>",
" -b, --cookie STRING/FILE Read cookies from STRING/FILE (H)", "CA directory to verify peer against"},
" -c, --cookie-jar FILE Write cookies to FILE after operation (H)", {"-E, --cert <certificate[:password]>",
" --create-dirs Create necessary local directory hierarchy", "Client certificate file and password"},
" --crlf Convert LF to CRLF in upload", {" --cert-status",
" --crlfile FILE Get a CRL list in PEM format from the given file", "Verify the status of the server certificate"},
" -d, --data DATA HTTP POST data (H)", {" --cert-type <type>",
" --data-raw DATA HTTP POST data, '@' allowed (H)", "Certificate file type (DER/PEM/ENG)"},
" --data-ascii DATA HTTP POST ASCII data (H)", {" --ciphers <list of ciphers>",
" --data-binary DATA HTTP POST binary data (H)", "SSL ciphers to use"},
" --data-urlencode DATA HTTP POST data url encoded (H)", {" --compressed",
" --delegation STRING GSS-API delegation permission", "Request compressed response"},
" --digest Use HTTP Digest Authentication (H)", {"-K, --config <file>",
" --disable-eprt Inhibit using EPRT or LPRT (F)", "Read config from a file"},
" --disable-epsv Inhibit using EPSV (F)", {" --connect-timeout <seconds>",
" --dns-servers DNS server addrs to use: 1.1.1.1;2.2.2.2", "Maximum time allowed for connection"},
" --dns-interface Interface to use for DNS requests", {" --connect-to <HOST1:PORT1:HOST2:PORT2>",
" --dns-ipv4-addr IPv4 address to use for DNS requests, dot notation", "Connect to host"},
" --dns-ipv6-addr IPv6 address to use for DNS requests, dot notation", {"-C, --continue-at <offset>",
" -D, --dump-header FILE Write the received headers to FILE", "Resumed transfer offset"},
" --egd-file FILE EGD socket path for random data (SSL)", {"-b, --cookie <data>",
" --engine ENGINE Crypto engine (use \"--engine list\" for list) (SSL)", "Send cookies from string/file"},
" --expect100-timeout SECONDS How long to wait for 100-continue (H)", {"-c, --cookie-jar <filename>",
" -f, --fail Fail silently (no output at all) on HTTP errors (H)", "Write cookies to <filename> after operation"},
" --fail-early Fail on first transfer error, do not continue", {" --create-dirs",
" --false-start Enable TLS False Start.", "Create necessary local directory hierarchy"},
" -F, --form CONTENT Specify HTTP multipart POST data (H)", {" --crlf",
" --form-string STRING Specify HTTP multipart POST data (H)", "Convert LF to CRLF in upload"},
" --ftp-account DATA Account data string (F)", {" --crlfile <file>",
" --ftp-alternative-to-user COMMAND " "Get a CRL list in PEM format from the given file"},
"String to replace \"USER [name]\" (F)", {"-d, --data <data>",
" --ftp-create-dirs Create the remote dirs if not present (F)", "HTTP POST data"},
" --ftp-method [MULTICWD/NOCWD/SINGLECWD] Control CWD usage (F)", {" --data-ascii <data>",
" --ftp-pasv Use PASV/EPSV instead of PORT (F)", "HTTP POST ASCII data"},
" -P, --ftp-port ADR Use PORT with given address instead of PASV (F)", {" --data-binary <data>",
" --ftp-skip-pasv-ip Skip the IP address for PASV (F)\n" "HTTP POST binary data"},
" --ftp-pret Send PRET before PASV (for drftpd) (F)", {" --data-raw <data>",
" --ftp-ssl-ccc Send CCC after authenticating (F)", "HTTP POST data, '@' allowed"},
" --ftp-ssl-ccc-mode ACTIVE/PASSIVE Set CCC mode (F)", {" --data-urlencode <data>",
" --ftp-ssl-control Require SSL/TLS for FTP login, " "HTTP POST data url encoded"},
"clear for transfer (F)", {" --delegation <LEVEL>",
" -G, --get Send the -d data with a HTTP GET (H)", "GSS-API delegation permission"},
" -g, --globoff Disable URL sequences and ranges using {} and []", {" --digest",
" -H, --header LINE Pass custom header LINE to server (H)", "Use HTTP Digest Authentication"},
" -I, --head Show document info only", {"-q, --disable",
" -h, --help This help text", "Disable .curlrc"},
" --hostpubmd5 MD5 " {" --disable-eprt",
"Hex-encoded MD5 string of the host public key. (SSH)", "Inhibit using EPRT or LPRT"},
" -0, --http1.0 Use HTTP 1.0 (H)", {" --disable-epsv",
" --http1.1 Use HTTP 1.1 (H)", "Inhibit using EPSV"},
" --http2 Use HTTP 2 (H)", {" --dns-interface <interface>",
" --http2-prior-knowledge Use HTTP 2 without HTTP/1.1 Upgrade (H)", "Interface to use for DNS requests"},
" --ignore-content-length Ignore the HTTP Content-Length header", {" --dns-ipv4-addr <address>",
" -i, --include Include protocol headers in the output (H/F)", "IPv4 address to use for DNS requests"},
" -k, --insecure Allow connections to SSL sites without certs (H)", {" --dns-ipv6-addr <address>",
" --interface INTERFACE Use network INTERFACE (or address)", "IPv6 address to use for DNS requests"},
" -4, --ipv4 Resolve name to IPv4 address", {" --dns-servers <addresses>",
" -6, --ipv6 Resolve name to IPv6 address", "DNS server addrs to use"},
" -j, --junk-session-cookies Ignore session cookies read from file (H)", {"-D, --dump-header <filename>",
" --keepalive-time SECONDS Wait SECONDS between keepalive probes", "Write the received headers to <filename>"},
" --key KEY Private key file name (SSL/SSH)", {" --egd-file <file>",
" --key-type TYPE Private key file type (DER/PEM/ENG) (SSL)", "EGD socket path for random data"},
" --krb LEVEL Enable Kerberos with security LEVEL (F)", {" --engine <name>",
#ifndef CURL_DISABLE_LIBCURL_OPTION "Crypto engine to use"},
" --libcurl FILE Dump libcurl equivalent code of this command line", {" --expect100-timeout <seconds>",
#endif "How long to wait for 100-continue"},
" --limit-rate RATE Limit transfer speed to RATE", {"-f, --fail",
" -l, --list-only List only mode (F/POP3)", "Fail silently (no output at all) on HTTP errors"},
" --local-port RANGE Force use of RANGE for local port numbers", {" --fail-early",
" -L, --location Follow redirects (H)", "Fail on first transfer error, do not continue"},
" --location-trusted " {" --false-start",
"Like '--location', and send auth to other hosts (H)", "Enable TLS False Start"},
" --login-options OPTIONS Server login options (IMAP, POP3, SMTP)", {"-F, --form <name=content>",
" -M, --manual Display the full manual", "Specify HTTP multipart POST data"},
" --mail-from FROM Mail from this address (SMTP)", {" --form-string <name=string>",
" --mail-rcpt TO Mail to this/these addresses (SMTP)", "Specify HTTP multipart POST data"},
" --mail-auth AUTH Originator address of the original email (SMTP)", {" --ftp-account <data>",
" --max-filesize BYTES Maximum file size to download (H/F)", "Account data string"},
" --max-redirs NUM Maximum number of redirects allowed (H)", {" --ftp-alternative-to-user <command>",
" -m, --max-time SECONDS Maximum time allowed for the transfer", "String to replace USER [name]"},
" --metalink Process given URLs as metalink XML file", {" --ftp-create-dirs",
" --negotiate Use HTTP Negotiate (SPNEGO) authentication (H)", "Create the remote dirs if not present"},
" -n, --netrc Must read .netrc for user name and password", {" --ftp-method <method>",
" --netrc-optional Use either .netrc or URL; overrides -n", "Control CWD usage"},
" --netrc-file FILE Specify FILE for netrc", {" --ftp-pasv",
" -:, --next " "Use PASV/EPSV instead of PORT"},
"Allows the following URL to use a separate set of options", {"-P, --ftp-port <address>",
" --no-alpn Disable the ALPN TLS extension (H)", "Use PORT instead of PASV"},
" -N, --no-buffer Disable buffering of the output stream", {" --ftp-pret",
" --no-keepalive Disable keepalive use on the connection", "Send PRET before PASV"},
" --no-npn Disable the NPN TLS extension (H)", {" --ftp-skip-pasv-ip",
" --no-sessionid Disable SSL session-ID reusing (SSL)", "Skip the IP address for PASV"},
" --noproxy List of hosts which do not use proxy", {" --ftp-ssl-ccc",
" --ntlm Use HTTP NTLM authentication (H)", "Send CCC after authenticating"},
" --ntlm-wb Use HTTP NTLM authentication with winbind (H)", {" --ftp-ssl-ccc-mode <active/passive>",
" --oauth2-bearer TOKEN OAuth 2 Bearer Token (IMAP, POP3, SMTP)", "Set CCC mode"},
" -o, --output FILE Write to FILE instead of stdout", {" --ftp-ssl-control",
" --pass PASS Pass phrase for the private key (SSL/SSH)", "Require SSL/TLS for FTP login, clear for transfer"},
" --path-as-is Do not squash .. sequences in URL path", {"-G, --get",
" --pinnedpubkey FILE/HASHES Public key to verify peer against (SSL)", "Put the post data in the URL and use GET"},
" --post301 " {"-g, --globoff",
"Do not switch to GET after following a 301 redirect (H)", "Disable URL sequences and ranges using {} and []"},
" --post302 " {"-I, --head",
"Do not switch to GET after following a 302 redirect (H)", "Show document info only"},
" --post303 " {"-H, --header <header>",
"Do not switch to GET after following a 303 redirect (H)", "Pass custom header LINE to server"},
" --preproxy [PROTOCOL://]HOST[:PORT] Proxy before HTTP(S) proxy", {"-h, --help",
" -#, --progress-bar Display transfer progress as a progress bar", "This help text"},
" --proto PROTOCOLS Enable/disable PROTOCOLS", {" --hostpubmd5 <md5>",
" --proto-default PROTOCOL Use PROTOCOL for any URL missing a scheme", "Acceptable MD5 hash of the host public key"},
" --proto-redir PROTOCOLS Enable/disable PROTOCOLS on redirect", {"-0, --http1.0",
" -x, --proxy [PROTOCOL://]HOST[:PORT] Use proxy on given port", "Use HTTP 1.0"},
" --proxy-anyauth Pick \"any\" proxy authentication method (H)", {" --http1.1",
" --proxy-basic Use Basic authentication on the proxy (H)", "Use HTTP 1.1"},
" --proxy-digest Use Digest authentication on the proxy (H)", {" --http2",
" --proxy-cacert FILE " "Use HTTP 2"},
"CA certificate to verify peer against for proxy (SSL)", {" --http2-prior-knowledge",
" --proxy-capath DIR " "Use HTTP 2 without HTTP/1.1 Upgrade"},
"CA directory to verify peer against for proxy (SSL)", {" --ignore-content-length",
" --proxy-cert CERT[:PASSWD] " "Ignore the size of the remote resource"},
"Client certificate file and password for proxy (SSL)", {"-i, --include",
" --proxy-cert-type TYPE " "Include protocol headers in the output"},
"Certificate file type (DER/PEM/ENG) for proxy (SSL)", {"-k, --insecure",
" --proxy-ciphers LIST SSL ciphers to use for proxy (SSL)", "Allow insecure server connections when using SSL"},
" --proxy-crlfile FILE " {" --interface <name>",
"Get a CRL list in PEM format from the given file for proxy", "Use network INTERFACE (or address)"},
" --proxy-insecure " {"-4, --ipv4",
"Allow connections to SSL sites without certs for proxy (H)", "Resolve names to IPv4 addresses"},
" --proxy-key KEY Private key file name for proxy (SSL)", {"-6, --ipv6",
" --proxy-key-type TYPE " "Resolve names to IPv6 addresses"},
"Private key file type for proxy (DER/PEM/ENG) (SSL)", {"-j, --junk-session-cookies",
" --proxy-negotiate " "Ignore session cookies read from file"},
"Use HTTP Negotiate (SPNEGO) authentication on the proxy (H)", {" --keepalive-time <seconds>",
" --proxy-ntlm Use NTLM authentication on the proxy (H)", "Interval time for keepalive probes"},
" --proxy-header LINE Pass custom header LINE to proxy (H)", {" --key <key>",
" --proxy-pass PASS Pass phrase for the private key for proxy (SSL)", "Private key file name"},
" --proxy-ssl-allow-beast " {" --key-type <type>",
"Allow security flaw to improve interop for proxy (SSL)", "Private key file type (DER/PEM/ENG)"},
" --proxy-tlsv1 Use TLSv1 for proxy (SSL)", {" --krb <level>",
" --proxy-tlsuser USER TLS username for proxy", "Enable Kerberos with security <level>"},
" --proxy-tlspassword STRING TLS password for proxy", {" --libcurl <file>",
" --proxy-tlsauthtype STRING " "Dump libcurl equivalent code of this command line"},
"TLS authentication type for proxy (default SRP)", {" --limit-rate <speed>",
" --proxy-service-name NAME SPNEGO proxy service name", "Limit transfer speed to RATE"},
" --service-name NAME SPNEGO service name", {"-l, --list-only",
" -U, --proxy-user USER[:PASSWORD] Proxy user and password", "List only mode"},
" --proxy1.0 HOST[:PORT] Use HTTP/1.0 proxy on given port", {" --local-port <num/range>",
" -p, --proxytunnel Operate through a HTTP proxy tunnel (using CONNECT)", "Force use of RANGE for local port numbers"},
" --pubkey KEY Public key file name (SSH)", {"-L, --location",
" -Q, --quote CMD Send command(s) to server before transfer (F/SFTP)", "Follow redirects"},
" --random-file FILE File for reading random data from (SSL)", {" --location-trusted",
" -r, --range RANGE Retrieve only the bytes within RANGE", "Like --location, and send auth to other hosts"},
" --raw Do HTTP \"raw\"; no transfer decoding (H)", {" --login-options <options>",
" -e, --referer Referer URL (H)", "Server login options"},
" -J, --remote-header-name Use the header-provided filename (H)", {" --mail-auth <address>",
" -O, --remote-name Write output to a file named as the remote file", "Originator address of the original email"},
" --remote-name-all Use the remote file name for all URLs", {" --mail-from <address>",
" -R, --remote-time Set the remote file's time on the local output", "Mail from this address"},
" -X, --request COMMAND Specify request command to use", {" --mail-rcpt <address>",
" --resolve HOST:PORT:ADDRESS Force resolve of HOST:PORT to ADDRESS", "Mail from this address"},
" --retry NUM " {"-M, --manual",
"Retry request NUM times if transient problems occur", "Display the full manual"},
" --retry-connrefused Retry on connection refused (use with --retry)", {" --max-filesize <bytes>",
" --retry-delay SECONDS Wait SECONDS between retries", "Maximum file size to download"},
" --retry-max-time SECONDS Retry only within this period", {" --max-redirs <num>",
" --sasl-ir Enable initial response in SASL authentication", "Maximum number of redirects allowed"},
" -S, --show-error " {"-m, --max-time <time>",
"Show error. With -s, make curl show errors when they occur", "Maximum time allowed for the transfer"},
" -s, --silent Silent mode (don't output anything)", {" --metalink",
" --socks4 HOST[:PORT] SOCKS4 proxy on given host + port", "Process given URLs as metalink XML file"},
" --socks4a HOST[:PORT] SOCKS4a proxy on given host + port", {" --negotiate",
" --socks5 HOST[:PORT] SOCKS5 proxy on given host + port", "Use HTTP Negotiate (SPNEGO) authentication"},
" --socks5-hostname HOST[:PORT] " {"-n, --netrc",
"SOCKS5 proxy, pass host name to proxy", "Must read .netrc for user name and password"},
" --socks5-gssapi-service NAME SOCKS5 proxy service name for GSS-API", {" --netrc-file <filename>",
" --socks5-gssapi-nec Compatibility with NEC SOCKS5 server", "Specify FILE for netrc"},
" -Y, --speed-limit RATE " {" --netrc-optional",
"Stop transfers below RATE for 'speed-time' secs", "Use either .netrc or URL"},
" -y, --speed-time SECONDS " {"-:, --next",
"Trigger 'speed-limit' abort after SECONDS (default: 30)", "Make next URL use its separate set of options"},
" --ssl Try SSL/TLS (FTP, IMAP, POP3, SMTP)", {" --no-alpn",
" --ssl-reqd Require SSL/TLS (FTP, IMAP, POP3, SMTP)", "Disable the ALPN TLS extension"},
" -2, --sslv2 Use SSLv2 (SSL)", {"-N, --no-buffer",
" -3, --sslv3 Use SSLv3 (SSL)", "Disable buffering of the output stream"},
" --ssl-allow-beast Allow security flaw to improve interop (SSL)", {" --no-keepalive",
" --ssl-no-revoke Disable cert revocation checks (WinSSL)", "Disable TCP keepalive on the connection"},
" --stderr FILE Where to redirect stderr (use \"-\" for stdout)", {" --no-npn",
" --suppress-connect-headers Suppress proxy CONNECT response headers", "Disable the NPN TLS extension"},
" --tcp-nodelay Use the TCP_NODELAY option", {" --no-sessionid",
" --tcp-fastopen Use TCP Fast Open", "Disable SSL session-ID reusing"},
" -t, --telnet-option OPT=VAL Set telnet option", {" --noproxy <no-proxy-list>",
" --tftp-blksize VALUE Set TFTP BLKSIZE option (must be >512)", "List of hosts which do not use proxy"},
" --tftp-no-options Do not send TFTP options requests", {" --ntlm",
" -z, --time-cond TIME Transfer based on a time condition", "Use HTTP NTLM authentication"},
" -1, --tlsv1 Use >= TLSv1 (SSL)", {" --ntlm-wb",
" --tlsv1.0 Use TLSv1.0 (SSL)", "Use HTTP NTLM authentication with winbind"},
" --tlsv1.1 Use TLSv1.1 (SSL)", {" --oauth2-bearer",
" --tlsv1.2 Use TLSv1.2 (SSL)", "OAuth 2 Bearer Token"},
" --tlsv1.3 Use TLSv1.3 (SSL)", {"-o, --output <file>",
" --tls-max VERSION Use TLS up to VERSION (SSL)", "Write to file instead of stdout"},
" --trace FILE Write a debug trace to FILE", {" --pass <phrase>",
" --trace-ascii FILE Like --trace, but without hex output", "Pass phrase for the private key"},
" --trace-time Add time stamps to trace/verbose output", {" --path-as-is",
" --tr-encoding Request compressed transfer encoding (H)", "Do not squash .. sequences in URL path"},
" -T, --upload-file FILE Transfer FILE to destination", {" --pinnedpubkey <hashes>",
" --url URL URL to work with", "FILE/HASHES Public key to verify peer against"},
" -B, --use-ascii Use ASCII/text transfer", {" --post301",
" -u, --user USER[:PASSWORD] Server user and password", "Do not switch to GET after following a 301"},
" --tlsuser USER TLS username", {" --post302",
" --tlspassword STRING TLS password", "Do not switch to GET after following a 302"},
" --tlsauthtype STRING TLS authentication type (default: SRP)", {" --post303",
" --unix-socket PATH Connect through this Unix domain socket", "Do not switch to GET after following a 303"},
" --abstract-unix-socket PATH Connect to an abstract Unix domain socket", {" --preproxy [protocol://]host[:port]",
" -A, --user-agent STRING Send User-Agent STRING to server (H)", "Use this proxy first"},
" -v, --verbose Make the operation more talkative", {"-#, --progress-bar",
" -V, --version Show version number and quit", "Display transfer progress as a bar"},
#ifdef USE_WATT32 {" --proto <protocols>",
" --wdebug Turn on Watt-32 debugging", "Enable/disable PROTOCOLS"},
#endif {" --proto-default <protocol>",
" -w, --write-out FORMAT Use output FORMAT after completion", "Use PROTOCOL for any URL missing a scheme"},
" --xattr Store metadata in extended file attributes", {" --proto-redir <protocols>",
" -q, --disable Disable .curlrc (must be first parameter)", "Enable/disable PROTOCOLS on redirect"},
NULL {"-x, --proxy [protocol://]host[:port]",
"Use this proxy"},
{" --proxy-anyauth",
"Pick any proxy authentication method"},
{" --proxy-basic",
"Use Basic authentication on the proxy"},
{" --proxy-cacert <file>",
"CA certificate to verify peer against for proxy"},
{" --proxy-capath <dir>",
"CA directory to verify peer against for proxy"},
{" --proxy-cert <cert[:passwd]>",
"Set client certificate for proxy"},
{" --proxy-cert-type <type>",
"Client certificate type for HTTS proxy"},
{" --proxy-ciphers <list>",
"SSL ciphers to use for proxy"},
{" --proxy-crlfile <file>",
"Set a CRL list for proxy"},
{" --proxy-digest",
"Use Digest authentication on the proxy"},
{" --proxy-header <header>",
"Pass custom header LINE to proxy"},
{" --proxy-insecure",
"Do HTTPS proxy connections without verifying the proxy"},
{" --proxy-key <key>",
"Private key for HTTPS proxy"},
{" --proxy-key-type <type>",
"Private key file type for proxy"},
{" --proxy-negotiate",
"Use HTTP Negotiate (SPNEGO) authentication on the proxy"},
{" --proxy-ntlm",
"Use NTLM authentication on the proxy"},
{" --proxy-pass <phrase>",
"Pass phrase for the private key for HTTPS proxy"},
{" --proxy-service-name <name>",
"SPNEGO proxy service name"},
{" --proxy-ssl-allow-beast",
"Allow security flaw for interop for HTTPS proxy"},
{" --proxy-tlsauthtype <type>",
"TLS authentication type for HTTPS proxy"},
{" --proxy-tlspassword <string>",
"TLS password for HTTPS proxy"},
{" --proxy-tlsuser <name>",
"TLS username for HTTPS proxy"},
{" --proxy-tlsv1",
"Use TLSv1 for HTTPS proxy"},
{"-U, --proxy-user <user:password>",
"Proxy user and password"},
{" --proxy1.0 <host[:port]>",
"Use HTTP/1.0 proxy on given port"},
{"-p, --proxytunnel",
"Operate through a HTTP proxy tunnel (using CONNECT)"},
{" --pubkey <key>",
"SSH Public key file name"},
{"-Q, --quote",
"Send command(s) to server before transfer"},
{" --random-file <file>",
"File for reading random data from"},
{"-r, --range <range>",
"Retrieve only the bytes within RANGE"},
{" --raw",
"Do HTTP \"raw\"; no transfer decoding"},
{"-e, --referer <URL>",
"Referrer URL"},
{"-J, --remote-header-name",
"Use the header-provided filename"},
{"-O, --remote-name",
"Write output to a file named as the remote file"},
{" --remote-name-all",
"Use the remote file name for all URLs"},
{"-R, --remote-time",
"Set the remote file's time on the local output"},
{"-X, --request <command>",
"Specify request command to use"},
{" --resolve <host:port:address>",
"Resolve the host+port to this address"},
{" --retry <num>",
"Retry request if transient problems occur"},
{" --retry-connrefused",
"Retry on connection refused (use with --retry)"},
{" --retry-delay <seconds>",
"Wait time between retries"},
{" --retry-max-time <seconds>",
"Retry only within this period"},
{" --sasl-ir",
"Enable initial response in SASL authentication"},
{" --service-name <name>",
"SPNEGO service name"},
{"-S, --show-error",
"Show error even when -s is used"},
{"-s, --silent",
"Silent mode"},
{" --socks4 <host[:port]>",
"SOCKS4 proxy on given host + port"},
{" --socks4a <host[:port]>",
"SOCKS4a proxy on given host + port"},
{" --socks5 <host[:port]>",
"SOCKS5 proxy on given host + port"},
{" --socks5-gssapi-nec",
"Compatibility with NEC SOCKS5 server"},
{" --socks5-gssapi-service <name>",
"SOCKS5 proxy service name for GSS-API"},
{" --socks5-hostname <host[:port]>",
"SOCKS5 proxy, pass host name to proxy"},
{"-Y, --speed-limit <speed>",
"Stop transfers slower than this"},
{"-y, --speed-time <seconds>",
"Trigger 'speed-limit' abort after this time"},
{" --ssl",
"Try SSL/TLS"},
{" --ssl-allow-beast",
"Allow security flaw to improve interop"},
{" --ssl-no-revoke",
"Disable cert revocation checks (WinSSL)"},
{" --ssl-reqd",
"Require SSL/TLS"},
{"-2, --sslv2",
"Use SSLv2"},
{"-3, --sslv3",
"Use SSLv3"},
{" --stderr",
"Where to redirect stderr"},
{" --suppress-connect-headers",
"Suppress proxy CONNECT response headers"},
{" --tcp-fastopen",
"Use TCP Fast Open"},
{" --tcp-nodelay",
"Use the TCP_NODELAY option"},
{"-t, --telnet-option <opt=val>",
"Set telnet option"},
{" --tftp-blksize <value>",
"Set TFTP BLKSIZE option"},
{" --tftp-no-options",
"Do not send any TFTP options"},
{"-z, --time-cond <time>",
"Transfer based on a time condition"},
{" --tls-max <VERSION>",
"Use TLSv1.0 or greater"},
{" --tlsauthtype <type>",
"TLS authentication type"},
{" --tlspassword",
"TLS password"},
{" --tlsuser <name>",
"TLS user name"},
{"-1, --tlsv1",
"Use TLSv1.0 or greater"},
{" --tlsv1.0",
"Use TLSv1.0"},
{" --tlsv1.1",
"Use TLSv1.1"},
{" --tlsv1.2",
"Use TLSv1.2"},
{" --tlsv1.3",
"Use TLSv1.3"},
{" --tr-encoding",
"Request compressed transfer encoding"},
{" --trace <file>",
"Write a debug trace to FILE"},
{" --trace-ascii <file>",
"Like --trace, but without hex output"},
{" --trace-time",
"Add time stamps to trace/verbose output"},
{" --unix-socket <path>",
"Connect through this Unix domain socket"},
{"-T, --upload-file <file>",
"Transfer local FILE to destination"},
{" --url <url>",
"URL to work with"},
{"-B, --use-ascii",
"Use ASCII/text transfer"},
{"-u, --user <user:password>",
"Server user and password"},
{"-A, --user-agent <name>",
"Send User-Agent <name> to server"},
{"-v, --verbose",
"Make the operation more talkative"},
{"-V, --version",
"Show version number and quit"},
{"-w, --write-out <format>",
"Use output FORMAT after completion"},
{" --xattr",
"Store metadata in extended file attributes"},
{ NULL, NULL }
}; };
#ifdef NETWARE #ifdef NETWARE
@ -322,8 +501,9 @@ static const struct feat feats[] = {
void tool_help(void) void tool_help(void)
{ {
int i; int i;
for(i = 0; helptext[i]; i++) { puts("Usage: curl [options...] <url>");
puts(helptext[i]); for(i = 0; helptext[i].opt; i++) {
printf(" %-19s %s\n", helptext[i].opt, helptext[i].desc);
#ifdef PRINT_LINES_PAUSE #ifdef PRINT_LINES_PAUSE
if(i && ((i % PRINT_LINES_PAUSE) == 0)) if(i && ((i % PRINT_LINES_PAUSE) == 0))
tool_pressanykey(); tool_pressanykey();

View File

@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# Copyright (C) 2016, Daniel Stenberg, <daniel@haxx.se>, et al. # Copyright (C) 2016, 2017, 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
@ -232,7 +232,7 @@ my @toolhelp; # store all parsed parameters
while(<R>) { while(<R>) {
chomp; chomp;
my $l= $_; my $l= $_;
if(/^ \" *(.*)/) { if(/^ \{\" *(.*)/) {
my $str=$1; my $str=$1;
my $combo; my $combo;
if($str =~ /^-(.), --([a-z0-9.-]*)/) { if($str =~ /^-(.), --([a-z0-9.-]*)/) {