blob: a0060415f091598abd406f2ea79706e3cd2ee82f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
_curl()
{
local cur prev words cword
_init_completion || return
case $prev in
--ciphers|--connect-timeout|-C|--continue-at|--form|--form-string|\
--ftp-account|--ftp-alternative-to-user|-P|--ftp-port|-H|--header|-h|\
--help|--hostpubmd5|--keepalive-time|--krb|--limit-rate|--local-port|\
--mail-from|--mail-rcpt|--max-filesize|--max-redirs|-m|--max-time|\
--pass|--proto|--proto-redir|--proxy-user|--proxy1.0|-Q|--quote|-r|\
--range|-X|--request|--retry|--retry-delay|--retry-max-time|\
--socks5-gssapi-service|-t|--telnet-option|--tftp-blksize|-z|\
--time-cond|--url|-u|--user|-A|--user-agent|-V|--version|-w|--write-out)
return
;;
-K|--config|-b|--cookie|-c|--cookie-jar|-D|--dump-header|--egd-file|\
--key|--libcurl|-o|--output|--random-file|-T|--upload-file)
_filedir
return
;;
--cacert|-E|--cert)
_filedir '@(c?(e)rt|cer|pem|der)'
return
;;
--capath)
_filedir -d
return
;;
--cert-type|--key-type)
COMPREPLY=( $( compgen -W 'DER PEM ENG' -- "$cur" ) )
return
;;
--crlfile)
_filedir crl
return
;;
-d|--data|--data-ascii|--data-binary|--data-urlencode)
if [[ $cur == \@* ]]; then
cur=${cur:1}
_filedir
COMPREPLY=( "${COMPREPLY[@]/#/@}" )
fi
return
;;
--engine)
COMPREPLY=( $( compgen -W 'list' -- "$cur" ) )
return
;;
--ftp-method)
COMPREPLY=( $( compgen -W 'multicwd nocwd singlecwd' -- "$cur" ) )
return
;;
--ftp-ssl-ccc-mode)
COMPREPLY=( $( compgen -W 'active passive' -- "$cur" ) )
return
;;
--interface)
_available_interfaces -a
return
;;
-x|--proxy|--socks4|--socks4a|--socks5|--socks5-hostname)
_known_hosts_real
return
;;
--pubkey)
_filedir pub
return
;;
--stderr)
COMPREPLY=( $( compgen -W '-' -- "$cur" ) )
_filedir
return
;;
esac
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
fi
} &&
complete -F _curl curl
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
# sh-indent-comment: t
# indent-tabs-mode: nil
# End:
# ex: ts=4 sw=4 et filetype=sh
|