From dbd32f3241b297b96ee11a51da1a661f528ca026 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Tue, 5 Feb 2019 20:44:14 +0000 Subject: zsh.pl: update regex to better match curl -h output The current regex fails to match '<...>' arguments properly (e.g. those with spaces in them), which causes an completion script with wrong descriptions for some options. Here's a diff of the generated completion script, comparing the previous version to the one with this fix: --- /usr/share/zsh/vendor-completions/_curl 2019-01-15 20:47:40.000000000 +0000 +++ _curl 2019-02-05 20:57:29.453349040 +0000 @@ -9,48 +9,48 @@ _arguments -C -S \ --happy-eyeballs-timeout-ms'[How long to wait in milliseconds for IPv6 before trying IPv4]':'' \ + --resolve'[Resolve the host+port to this address]':'' \ {-c,--cookie-jar}'[Write cookies to after operation]':'':_files \ {-D,--dump-header}'[Write the received headers to ]':'':_files \ {-y,--speed-time}'[Trigger '\''speed-limit'\'' abort after this time]':'' \ --proxy-cacert'[CA certificate to verify peer against for proxy]':'':_files \ - --tls13-ciphers'[of TLS 1.3 ciphersuites> TLS 1.3 cipher suites to use]':'' \ {-E,--cert}'[Client certificate file and password]':'' \ --libcurl'[Dump libcurl equivalent code of this command line]':'':_files \ --proxy-capath'[CA directory to verify peer against for proxy]':'':_files \ - --proxy-negotiate'[HTTP Negotiate (SPNEGO) authentication on the proxy]':'Use' \ --proxy-pinnedpubkey'[FILE/HASHES public key to verify proxy with]':'' \ --crlfile'[Get a CRL list in PEM format from the given file]':'':_files \ - --proxy-insecure'[HTTPS proxy connections without verifying the proxy]':'Do' \ - --proxy-ssl-allow-beast'[security flaw for interop for HTTPS proxy]':'Allow' \ + --proxy-negotiate'[Use HTTP Negotiate (SPNEGO) authentication on the proxy]' \ --abstract-unix-socket'[Connect via abstract Unix domain socket]':'' \ --pinnedpubkey'[FILE/HASHES Public key to verify peer against]':'' \ + --proxy-insecure'[Do HTTPS proxy connections without verifying the proxy]' \ --proxy-pass'[Pass phrase for the private key for HTTPS proxy]':'' \ + --proxy-ssl-allow-beast'[Allow security flaw for interop for HTTPS proxy]' \ {-p,--proxytunnel}'[Operate through an HTTP proxy tunnel (using CONNECT)]' \ --socks5-hostname'[SOCKS5 proxy, pass host name to proxy]':'' \ --proto-default'[Use PROTOCOL for any URL missing a scheme]':'' \ - --proxy-tls13-ciphers'[list> TLS 1.3 proxy cipher suites]':'' \ --socks5-gssapi-service'[SOCKS5 proxy service name for GSS-API]':'' \ --ftp-alternative-to-user'[String to replace USER \[name\]]':'' \ - --ftp-ssl-control'[SSL/TLS for FTP login, clear for transfer]':'Require' \ {-T,--upload-file}'[Transfer local FILE to destination]':'':_files \ --local-port'[Force use of RANGE for local port numbers]':'' \ --proxy-tlsauthtype'[TLS authentication type for HTTPS proxy]':'' \ {-R,--remote-time}'[Set the remote file'\''s time on the local output]' \ - --retry-connrefused'[on connection refused (use with --retry)]':'Retry' \ - --suppress-connect-headers'[proxy CONNECT response headers]':'Suppress' \ - {-j,--junk-session-cookies}'[session cookies read from file]':'Ignore' \ - --location-trusted'[--location, and send auth to other hosts]':'Like' \ + --ftp-ssl-control'[Require SSL/TLS for FTP login, clear for transfer]' \ --proxy-cert-type'[Client certificate type for HTTPS proxy]':'' \ {-O,--remote-name}'[Write output to a file named as the remote file]' \ + --retry-connrefused'[Retry on connection refused (use with --retry)]' \ + --suppress-connect-headers'[Suppress proxy CONNECT response headers]' \ --trace-ascii'[Like --trace, but without hex output]':'':_files \ --connect-timeout'[Maximum time allowed for connection]':'' \ --expect100-timeout'[How long to wait for 100-continue]':'' \ {-g,--globoff}'[Disable URL sequences and ranges using {} and \[\]]' \ + {-j,--junk-session-cookies}'[Ignore session cookies read from file]' \ {-m,--max-time}'[Maximum time allowed for the transfer]':'' \ --dns-ipv4-addr'[IPv4 address to use for DNS requests]':'
' \ --dns-ipv6-addr'[IPv6 address to use for DNS requests]':'
' \ - --ignore-content-length'[the size of the remote resource]':'Ignore' \ {-k,--insecure}'[Allow insecure server connections when using SSL]' \ + --location-trusted'[Like --location, and send auth to other hosts]' \ --mail-auth'[Originator address of the original email]':'
' \ --noproxy'[List of hosts which do not use proxy]':'' \ --proto-redir'[Enable/disable PROTOCOLS on redirect]':'' \ @@ -62,18 +62,19 @@ --socks5-basic'[Enable username/password auth for SOCKS5 proxies]' \ --cacert'[CA certificate to verify peer against]':'':_files \ {-H,--header}'[Pass custom header(s) to server]':'
' \ + --ignore-content-length'[Ignore the size of the remote resource]' \ {-i,--include}'[Include protocol response headers in the output]' \ --proxy-header'[Pass custom header(s) to proxy]':'
' \ --unix-socket'[Connect through this Unix domain socket]':'' \ {-w,--write-out}'[Use output FORMAT after completion]':'' \ - --http2-prior-knowledge'[HTTP 2 without HTTP/1.1 Upgrade]':'Use' \ {-o,--output}'[Write to file instead of stdout]':'':_files \ - {-J,--remote-header-name}'[the header-provided filename]':'Use' \ + --preproxy'[\[protocol://\]host\[:port\] Use this proxy first]' \ --socks4a'[SOCKS4a proxy on given host + port]':'' \ {-Y,--speed-limit}'[Stop transfers slower than this]':'' \ {-z,--time-cond}'[Transfer based on a time condition]':'