summaryrefslogtreecommitdiff
path: root/completions/wget
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.net.br>2019-08-07 09:17:13 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.net.br>2019-08-07 09:17:13 -0300
commit5732da2af736c40cf693354485446ab4867ecb4d (patch)
tree76d76cdfa16ca62d20fb109da13895ec64fff110 /completions/wget
parent9cd22d1df8f0f5b554858471c86faa9f37b8fed4 (diff)
downloadbash-completion-5732da2af736c40cf693354485446ab4867ecb4d.tar.gz
New upstream version 2.9upstream/2.9
Diffstat (limited to 'completions/wget')
-rw-r--r--completions/wget78
1 files changed, 38 insertions, 40 deletions
diff --git a/completions/wget b/completions/wget
index 95011bef..b27d860d 100644
--- a/completions/wget
+++ b/completions/wget
@@ -6,18 +6,18 @@ _wget()
_init_completion -s || return
case $prev in
- -V|--version|-h|--help)
+ --version|--help|-!(-*)[hV])
return
;;
--progress)
- COMPREPLY=( $( compgen -W 'bar dot' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W 'bar dot' -- "$cur") )
return
;;
--bind-address)
- _ip_addresses "$cur"
+ _ip_addresses
return
;;
- -D|--domains|--exclude-domains)
+ --domains|--exclude-domains|-!(-*)D)
_known_hosts_real -- "$cur"
return
;;
@@ -37,53 +37,53 @@ _wget()
excludes+=( ascii )
;;
esac
- local excludes_str=$( export IFS='|'; echo "${excludes[*]}"; )
+ local excludes_str=$(export IFS='|'; echo "${excludes[*]}";)
# prevopt is the previous options string used as a prefix
# to avoid COMPREPLY replacing them with the $lastopt completion
local lastopt=${cur/*,} prevopt=
[[ $cur == *,* ]] && prevopt=${cur%,*},
- COMPREPLY=( $( compgen -P "$prevopt" -X "@($excludes_str)" \
+ COMPREPLY=( $(compgen -P "$prevopt" -X "@($excludes_str)" \
-W 'unix windows nocontrol ascii lowercase uppercase' \
- -- "$lastopt" ) )
+ -- "$lastopt") )
# +o nospace when no more valid option is possible (= append a space)
- local opt_as_arr=( $( echo ${COMPREPLY[0]//,/ } ) )
+ local opt_as_arr=( $(echo ${COMPREPLY[0]//,/ }) )
[[ ${#opt_as_arr[@]} -lt 4 ]] && compopt -o nospace
return
;;
--prefer-family)
- COMPREPLY=( $( compgen -W 'IPv4 IPv6 none' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W 'IPv4 IPv6 none' -- "$cur") )
return
;;
- -P|--directory-prefix|--ca-directory|--warc-tempdir)
+ --directory-prefix|--ca-directory|--warc-tempdir|-!(-*)P)
_filedir -d
return
;;
- -o|--output-file|-a|--append-output|--config|--load-cookies|\
- --save-cookies|--post-file|--certificate|--ca-certificate|\
- --private-key|--random-file|--egd-file|--warc-file|--warc-dedup)
+ --output-file|--append-output|--config|--load-cookies|--save-cookies|\
+ --post-file|--certificate|--ca-certificate|--private-key|\
+ --random-file|--egd-file|--warc-file|--warc-dedup|-!(-*)[oa])
_filedir
return
;;
- -O|--output-document|-i|--input-file)
+ --output-document|--input-file|-!(-*)[Oi])
_filedir && [[ $cur == - || -z $cur ]] && COMPREPLY+=( - )
return
;;
--secure-protocol)
- COMPREPLY=( $( compgen -W 'auto SSLv2 SSLv3 TLSv1' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W 'auto SSLv2 SSLv3 TLSv1' -- "$cur") )
return
;;
--certificate-type|--private-key-type)
- COMPREPLY=( $( compgen -W 'PEM DER' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W 'PEM DER' -- "$cur") )
return
;;
--follow-tags|--ignore-tags)
local lastopt=${cur/*,} prevopt=
[[ $cur == *,* ]] && prevopt=${cur%,*},
- COMPREPLY=( $( compgen -P "$prevopt" -W 'a abbr acronym address
+ COMPREPLY=( $(compgen -P "$prevopt" -W 'a abbr acronym address
applet area b base basefont bdo big blockquote body br button
caption center cite code col colgroup dd del dir div dfn dl dt
em fieldset font form frame frameset h6 head hr html i iframe
@@ -91,37 +91,37 @@ _wget()
noframes noscript object ol optgroup option p param pre q s
samp script select small span strike strong style sub sup table
tbody td textarea tfoot th thead title tr tt u ul var xmp' \
- -- "$lastopt" ) )
+ -- "$lastopt") )
return
;;
- -t|--tries|-T|--timeout|--dns-timeout|--connect-timeout|--read-timeout|\
- -w|--wait|--waitretry|--cut-dirs|--max-redirect|-l|--level)
+ --tries|--timeout|--dns-timeout|--connect-timeout|--read-timeout|\
+ --wait|--waitretry|--cut-dirs|--max-redirect|--level|-!(-*)[tTwl])
# expect integer number
- COMPREPLY+=( $( compgen -P "$cur" -W "{0..9}" ) )
+ COMPREPLY+=( $(compgen -P "$cur" -W "{0..9}") )
compopt -o nospace
return
;;
- -Q|--quota|--limit-rate|--warc-max-size)
+ --quota|--limit-rate|--warc-max-size|-!(-*)Q)
# expect size
if [[ $cur == *[km] ]]; then
- COMPREPLY=( $( compgen -W "$cur" ) )
+ COMPREPLY=( $(compgen -W "$cur") )
elif [[ $cur ]]; then
- COMPREPLY=( $( compgen -P "$cur" -W "{0..9} k m" ) )
+ COMPREPLY=( $(compgen -P "$cur" -W "{0..9} k m") )
compopt -o nospace
else
- COMPREPLY=( $( compgen -W "{0..9}" ) )
+ COMPREPLY=( $(compgen -W "{0..9}") )
compopt -o nospace
fi
return
;;
--user|--http-user|--proxy-user|--ftp-user)
- COMPREPLY=( $( compgen -W "$( command sed -n \
+ COMPREPLY=( $(compgen -W "$(command sed -n \
'/^login/s/^[[:blank:]]*login[[:blank:]]//p' ~/.netrc \
- 2>/dev/null )" -- "$cur" ) )
+ 2>/dev/null)" -- "$cur") )
return
;;
--header)
- COMPREPLY=( $( compgen -W 'Accept Accept-Charset Accept-Encoding
+ COMPREPLY=( $(compgen -W 'Accept Accept-Charset Accept-Encoding
Accept-Language Accept-Ranges Age Allow Authorization
Cache-Control Connection Content-Encoding Content-Language
Content-Length Content-Location Content-MD5 Content-Range
@@ -130,31 +130,29 @@ _wget()
Last-Modified Location Max-Forwards Pragma Proxy-Authenticate
Proxy-Authorization Range Referer Retry-After Server TE Trailer
Transfer-Encoding Upgrade User-Agent Vary Via Warning
- WWW-Authenticate' -- "$cur" ) )
+ WWW-Authenticate' -- "$cur") )
compopt -o nospace
return
;;
--local-encoding|--remote-encoding)
- type -P xauth &>/dev/null && \
- COMPREPLY=( $( compgen -W '$( iconv -l 2>/dev/null | \
- command sed -e "s@/*\$@@" -e "s/[,()]//g" 2>/dev/null )' -- "$cur" ) )
+ type -P xauth &>/dev/null && _xfunc iconv _iconv_charsets
return
;;
- -e|--execute)
+ --execute|-!(-*)e)
return # TODO base=STR
;;
--report-speed)
- COMPREPLY=( $( compgen -W 'bits' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W 'bits' -- "$cur") )
return
;;
--regex-type)
- COMPREPLY=( $( compgen -W 'posix' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W 'posix' -- "$cur") )
return
;;
- -B|--base|--password|--ftp-password|--http-password|--proxy-password|\
- --default-page|--referer|-U|--user-agent|--post-data|--warc-header|-A|\
- --accept|-R|--reject|--accept-regex|--reject-regex|-I|\
- --include-directories|-X|--exclude-directories)
+ --base|--password|--ftp-password|--http-password|--proxy-password|\
+ --default-page|--referer|--user-agent|--post-data|--warc-header|\
+ --accept|--reject|--accept-regex|--reject-regex|--include-directories|\
+ --exclude-directories|-!(-*)[BUARIX])
# argument required but no completions available
return
;;
@@ -163,7 +161,7 @@ _wget()
$split && return
if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
fi