@@ -6,40 +6,50 @@ _curl()
6
6
_init_completion || return
7
7
8
8
case $prev in
9
- --ciphers | --connect-timeout | --continue-at | --form | --form-string | \
10
- --ftp-account | --ftp-alternative-to-user | --ftp-port | --header | \
11
- --hostpubmd5 | --keepalive-time | --krb | --limit-rate | --local-port | \
12
- --mail-from | --mail-rcpt | --max-filesize | --max-redirs | --max-time | --pass | \
13
- --proto | --proto-redir | --proxy-user | --proxy1.0 | --quote | --range | \
14
- --request | --retry | --retry-delay | --retry-max-time | \
15
- --socks5-gssapi-service | --telnet-option | --tftp-blksize | --time-cond | \
16
- --url | --user | --user-agent | --version | --write-out | --resolve | --tlsuser | \
17
- --tlspassword | -! (-* )[CFPHmQrXtzuAVw])
18
- return
19
- ;;
20
- --config | --cookie | --cookie-jar | --dump-header | --egd-file | \
21
- --key | --libcurl | --output | --random-file | --upload-file | --trace | \
22
- --trace-ascii | --netrc-file | -! (-* )[KbcDoT])
9
+ --abstract-unix-socket | --alt-svc | --config | --cookie | \
10
+ --cookie-jar | --dump-header | --egd-file | --etag-compare | \
11
+ --etag-save | --hsts | --key | --libcurl | --netrc-file | \
12
+ --output | --proxy-key | --random-file | --trace | --trace-ascii | \
13
+ --unix-socket | --upload-file | -! (-* )[KbcDoT])
23
14
_filedir
24
15
return
25
16
;;
26
- --cacert | --cert | -! (-* )E)
17
+ --ciphers | --connect-timeout | --connect-to | --continue-at | \
18
+ --curves | --data-raw | --doh-url | --expect100-timeout | --form | \
19
+ --form-string | --ftp-account | --ftp-alternative-to-user | \
20
+ --happy-eyeballs-timeout-ms | --hostpubmd5 | --keepalive-time | \
21
+ --limit-rate | --local-port | --login-options | --mail-auth | \
22
+ --mail-from | --mail-rcpt | --max-filesize | --max-redirs | \
23
+ --max-time | --pass | --proto | --proto-default | --proto-redir | \
24
+ --proxy-ciphers | --proxy-pass | --proxy-service-name | \
25
+ --proxy-tls13-ciphers | --proxy-tlspassword | --proxy-tlsuser | \
26
+ --proxy-user | --proxy1.0 | --quote | --range | --referer | \
27
+ --resolve | --retry | --retry-delay | --retry-max-time | \
28
+ --sasl-authzid | --service-name | --socks5-gssapi-service | \
29
+ --speed-limit | --speed-time | --telnet-option | --tftp-blksize | \
30
+ --time-cond | --tls13-ciphers | --tlspassword | --tlsuser | \
31
+ --url | --user | --user-agent | --version | --write-out | \
32
+ -! (-* )[CFmQreYytzuAVw])
33
+ return
34
+ ;;
35
+ --cacert | --cert | --proxy-cacert | --proxy-cert | -! (-* )E)
27
36
_filedir ' @(c?(e)rt|cer|pem|der)'
28
37
return
29
38
;;
30
- --capath)
39
+ --capath | --output-dir | --proxy-capath )
31
40
_filedir -d
32
41
return
33
42
;;
34
- --cert-type | --key-type)
43
+ --cert-type | --key-type | --proxy-cert-type | --proxy-key-type )
35
44
COMPREPLY=($( compgen -W ' DER PEM ENG' -- " $cur " ) )
36
45
return
37
46
;;
38
- --crlfile)
47
+ --crlfile | --proxy-crlfile )
39
48
_filedir crl
40
49
return
41
50
;;
42
- --data | --data-ascii | --data-binary | --data-urlencode | -! (-* )d)
51
+ --data | --data-ascii | --data-binary | --data-urlencode | --header | \
52
+ --proxy-header | -! (-* )[dH])
43
53
if [[ $cur == \@ * ]]; then
44
54
cur=${cur: 1}
45
55
_filedir
@@ -55,8 +65,27 @@ _curl()
55
65
COMPREPLY=($( compgen -W ' none policy always' -- " $cur " ) )
56
66
return
57
67
;;
68
+ --dns-ipv[46]-addr)
69
+ _ip_addresses -${prev: 9: 1}
70
+ return
71
+ ;;
72
+ --dns-servers | --noproxy)
73
+ _known_hosts_real -- " ${cur##* ,} "
74
+ _comp_delimited , -W ' ${COMPREPLY[@]}'
75
+ return
76
+ ;;
58
77
--engine)
59
- COMPREPLY=($( compgen -W ' list' -- " $cur " ) )
78
+ local engines=$(
79
+ " $1 " --engine list 2> /dev/null |
80
+ command grep " ^[[:space:]]"
81
+ )
82
+ COMPREPLY=($( compgen -W ' $engines list' -- " $cur " ) )
83
+ return
84
+ ;;
85
+ --ftp-port | -! (-* )P)
86
+ _available_interfaces -a
87
+ _known_hosts_real -- " $cur "
88
+ _ip_addresses -a
60
89
return
61
90
;;
62
91
--ftp-method)
@@ -83,20 +112,42 @@ _curl()
83
112
COMPREPLY=($( compgen -W ' ${categories[@]}' -- " $cur " ) )
84
113
return
85
114
;;
86
- --proxy | --socks4 | --socks4a | --socks5 | --socks5-hostname | -! (-* )x)
115
+ --krb)
116
+ COMPREPLY=($( compgen -W ' clear safe confidential private' -- " $cur " ) )
117
+ return
118
+ ;;
119
+ --pinnedpubkey | --proxy-pinnedpubkey)
120
+ _filedir ' @(pem|der|key)'
121
+ return
122
+ ;;
123
+ --preproxy | --proxy | --socks4 | --socks4a | --socks5 | \
124
+ --socks5-hostname | -! (-* )x)
87
125
_known_hosts_real -- " $cur "
88
126
return
89
127
;;
90
128
--pubkey)
91
129
_xfunc ssh _ssh_identityfile pub
92
130
return
93
131
;;
132
+ --request | -! (-* )X)
133
+ # TODO: these are valid for http(s) only
134
+ COMPREPLY=($(
135
+ compgen -W \
136
+ ' GET HEAD POST PUT DELETE CONNECT OPTIONS TRACE PATCH' \
137
+ -- " $cur "
138
+ ) )
139
+ return
140
+ ;;
94
141
--stderr)
95
142
COMPREPLY=($( compgen -W ' -' -- " $cur " ) )
96
143
_filedir
97
144
return
98
145
;;
99
- --tlsauthtype)
146
+ --tls-max)
147
+ COMPREPLY=($( compgen -W ' default 1.0 1.1 1.2 1.3' -- " $cur " ) )
148
+ return
149
+ ;;
150
+ --tlsauthtype | --proxy-tlsauthtype)
100
151
COMPREPLY=($( compgen -W ' SRP' -- " $cur " ) )
101
152
return
102
153
;;
0 commit comments