# curl(1) completion -*- shell-script -*- proc _curl { local cur prev words cword _init_completion || return match $prev { with --ciphers|--connect-timeout|-C|--continue-at|-F|--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|--resolve|--tlsuser|--tlspassword return with -K|--config|-b|--cookie|-c|--cookie-jar|-D|--dump-header|--egd-file|\ --key|--libcurl|-o|--output|--random-file|-T|--upload-file|--trace|\ --trace-ascii|--netrc-file _filedir return with --cacert|-E|--cert _filedir '@(c?(e)rt|cer|pem|der)' return with --capath _filedir -d return with --cert-type|--key-type setglobal COMPREPLY = ''( $( compgen -W 'DER PEM ENG' -- "$cur" ) ) return with --crlfile _filedir crl return with -d|--data|--data-ascii|--data-binary|--data-urlencode if [[ $cur == \@* ]] { setglobal cur = $(cur:1) _filedir setglobal COMPREPLY = ''( "${COMPREPLY[@]/#/@}" ) } return with --delegation setglobal COMPREPLY = ''( $( compgen -W 'none policy always' -- "$cur" ) ) return with --engine setglobal COMPREPLY = ''( $( compgen -W 'list' -- "$cur" ) ) return with --ftp-method setglobal COMPREPLY = ''( $( compgen -W 'multicwd nocwd singlecwd' -- "$cur" ) ) return with --ftp-ssl-ccc-mode setglobal COMPREPLY = ''( $( compgen -W 'active passive' -- "$cur" ) ) return with --interface _available_interfaces -a return with -x|--proxy|--socks4|--socks4a|--socks5|--socks5-hostname _known_hosts_real return with --pubkey _filedir pub return with --stderr setglobal COMPREPLY = ''( $( compgen -W '-' -- "$cur" ) ) _filedir return with --tlsauthtype setglobal COMPREPLY = ''( $( compgen -W 'SRP' -- "$cur" ) ) return } if [[ $cur == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) } } && complete -F _curl curl # ex: ts=4 sw=4 et filetype=sh