[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 2.1-16-g5c6b1bb
Ville Skyttä
ville.skytta at iki.fi
Thu May 9 11:04:46 UTC 2013
The following commit has been merged in the master branch:
commit d99c2203b9ff6e35ce12fbe0572773a9f3abeadb
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Thu May 9 13:42:32 2013 +0300
Clean up/compact various globs.
diff --git a/bash_completion b/bash_completion
index cb7aba1..e997848 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1888,7 +1888,7 @@ _install_xspec '!*.fig' xfig
_install_xspec '!*.@(mid?(i)|cmf)' playmidi
_install_xspec '!*.@(mid?(i)|rmi|rcp|[gr]36|g18|mod|xm|it|x3m|s[3t]m|kar)' timidity
_install_xspec '!*.@(669|abc|am[fs]|d[bs]m|dmf|far|it|mdl|m[eo]d|mid?(i)|mt[2m]|okta|p[st]m|s[3t]m|ult|umx|wav|xm)' modplugplay modplug123
-_install_xspec '*.@(o|so|so.!(conf|*/*)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite
+_install_xspec '*.@([ao]|so|so.!(conf|*/*)|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite
_install_xspec '!*.@(zip|z|gz|tgz)' bzme
# konqueror not here on purpose, it's more than a web/html browser
_install_xspec '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx galeon dillo elinks amaya firefox mozilla-firefox iceweasel google-chrome chromium-browser epiphany
diff --git a/completions/_subversion b/completions/_subversion
index 2f1752c..ce61e2c 100644
--- a/completions/_subversion
+++ b/completions/_subversion
@@ -198,7 +198,7 @@ _svn()
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
else
- if [[ "$command" == @(help|h|\?) ]]; then
+ if [[ "$command" == @(help|[h?]) ]]; then
COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
else
_filedir
@@ -271,7 +271,7 @@ _svnadmin()
options+=" --help"
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
else
- if [[ "$command" == @(help|h|\?) ]]; then
+ if [[ "$command" == @(help|[h?]) ]]; then
COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
else
_filedir
@@ -329,7 +329,7 @@ _svnlook()
options+=" --help"
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
else
- if [[ "$command" == @(help|h|\?) ]]; then
+ if [[ "$command" == @(help|[h?]) ]]; then
COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
else
_filedir
diff --git a/completions/_yum-utils b/completions/_yum-utils
index 22b97af..2deb654 100644
--- a/completions/_yum-utils
+++ b/completions/_yum-utils
@@ -8,7 +8,7 @@ _repomanage()
local cur prev words cword split
_init_completion -s || return
- [[ "$prev" == -@(h|-help|k|-keep) ]] && return 0
+ [[ "$prev" == -@([hk]|-help|-keep) ]] && return 0
$split && return
diff --git a/completions/cppcheck b/completions/cppcheck
index 64bb9b0..9c20ca1 100644
--- a/completions/cppcheck
+++ b/completions/cppcheck
@@ -71,7 +71,7 @@ _cppcheck()
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
else
- _filedir @(cpp|cxx|cc|c++|c|h|hpp|hxx|h++|tpp|txx)
+ _filedir @([cht]pp|[cht]xx|cc|[ch]++|[ch])
fi
} &&
complete -F _cppcheck cppcheck
diff --git a/completions/crontab b/completions/crontab
index ddd0066..bc15b52 100644
--- a/completions/crontab
+++ b/completions/crontab
@@ -41,7 +41,7 @@ _crontab()
fi
# do filenames only if we did not have -l, -r, or -e
- [[ "${words[@]}" == *\ -@(l|r|e)* ]] || _filedir
+ [[ "${words[@]}" == *\ -[lre]* ]] || _filedir
} &&
complete -F _crontab crontab
diff --git a/completions/cvs b/completions/cvs
index 53ed7d5..6c72efe 100644
--- a/completions/cvs
+++ b/completions/cvs
@@ -195,7 +195,7 @@ _cvs()
fi
;;
annotate)
- [[ "$prev" == -@(r|D) ]] && return 0
+ [[ "$prev" == -[rD] ]] && return 0
if [[ "$cur" == -* ]]; then
_cvs_command_options "$1" $mode
diff --git a/completions/dot b/completions/dot
index ef946e4..a715fba 100644
--- a/completions/dot
+++ b/completions/dot
@@ -5,7 +5,7 @@ _dot()
local cur prev words cword
_init_completion -n := || return
- [[ $prev == -@(V|\?) ]] && return
+ [[ $prev == -[V?] ]] && return
case $cur in
-G*|-N*|-E*|-l?*|-q?*|-s?*|-Ln*|-LU*|-LC*|-LT*)
@@ -34,7 +34,7 @@ _dot()
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '-V -v -G -N -E -T -K -l -o -O -P -q -s -y -n
-n1 -n2 -x -Lg -LO -Ln -LU -LC -LT -m -c -?' -- "$cur" ) )
- [[ $COMPREPLY == -@(G|N|E|T|K|o|L[nUCT]) ]] && compopt -o nospace
+ [[ $COMPREPLY == -@([GNETKo]|L[nUCT]) ]] && compopt -o nospace
return
fi
diff --git a/completions/nc b/completions/nc
index 055924c..e99699e 100644
--- a/completions/nc
+++ b/completions/nc
@@ -36,9 +36,7 @@ _nc()
# Complete 1st non-option arg only
local i
for (( i=1; i < cword; i++ )); do
- [[ ${words[i]} != -* && \
- ${words[i-1]} != @(-I|-i|-O|-P|-p|-s|-T|-V|-w|-X|-x) ]] && \
- return
+ [[ ${words[i]} != -* && ${words[i-1]} != -[IiOPpsTVwXx] ]] && return
done
_known_hosts_real "$cur"
diff --git a/completions/perl b/completions/perl
index 4bcc9b0..f41a309 100644
--- a/completions/perl
+++ b/completions/perl
@@ -127,7 +127,7 @@ _perldoc()
-- "$cur" ) )
fi
fi
- _filedir 'p@(l|m|od)'
+ _filedir 'p@([lm]|od)'
fi
} &&
complete -F _perldoc -o bashdefault perldoc
diff --git a/completions/pkg-get b/completions/pkg-get
index 6933906..35e443c 100644
--- a/completions/pkg-get
+++ b/completions/pkg-get
@@ -43,13 +43,13 @@ _pkg-get()
if [[ "${COMP_WORDS[$i]}" == -s ]]; then
url="${COMP_WORDS[$((i+1))]}"
fi
- if [[ "${COMP_WORDS[$i]}" == @(available|-a|describe|-D|download|-d|install|-i|list|updatecatalog|-U|upgrade|-u) ]]; then
+ if [[ "${COMP_WORDS[$i]}" == @(-[aDdiUu]|available|describe|download|install|list|updatecatalog|upgrade) ]]; then
command="${COMP_WORDS[$i]}"
fi
done
if [[ -n "$command" ]]; then
- if [[ "$command" == @(describe|-D|download|-d|install|-i) ]]; then
+ if [[ "$command" == @(-[Ddi]|describe|download|install) ]]; then
catalog_file=$(_pkg-get_get_catalog_file "$url")
if [[ -f $catalog_file ]]; then
local packages_list=$(awk ' $0 ~ /BEGIN PGP SIGNATURE/ { exit } $1 ~ /^Hash:/ || $1 ~ /^ *(-|#|$)/ { next } { print $1 }' $catalog_file)
diff --git a/completions/pkgutil b/completions/pkgutil
index 5e31b00..3c2757d 100644
--- a/completions/pkgutil
+++ b/completions/pkgutil
@@ -23,28 +23,28 @@ _pkgutil()
i=$cword
while [[ $((i--)) -gt 1 ]]; do
- if [[ "${words[$i]}" == @(-t|--temp) ]]; then
+ if [[ "${words[$i]}" == -@(t|-temp) ]]; then
local url="${words[$((i+1))]}"
local catalog=$(_pkgutil_url2catalog "$url")
catalog_files=("$catalog")
elif [[ "${words[$i]}" == --config ]]; then
configuration_files=( "$(dequote ${words[$((i+1))]})" )
- elif [[ "${words[$i]}" == @(-i|--install|-u|--upgrade|-r|--remove|-d|--download|-a|--available|-c|--compare|-U|--catalog|-S|--stream) ]]; then
+ elif [[ "${words[$i]}" == -@([iurdacUS]|-install|-upgrade|-remove|-download|-available|-compare|-catalog|-stream) ]]; then
command="${words[$i]}"
fi
done
- if [[ "$prev" == @(-W|--workdir|-P|--pkgdir|-R|--rootpath) ]]; then
+ if [[ "$prev" == -@([WPR]|-workdir|-pkgdir|-rootpath) ]]; then
_filedir -d
return 0
fi
- if [[ "$prev" == @(-o|--output|--config) ]]; then
+ if [[ "$prev" == -@(o|-output|-config) ]]; then
_filedir
return 0
fi
- if [[ "$prev" == @(-p|--param) ]]; then
+ if [[ "$prev" == -@(p|-param) ]]; then
compopt -o nospace
COMPREPLY=( $(compgen -W "mirror: pkgaddopts: pkgrmopts: wgetopts: use_gpg: use_md5: pkgliststyle: maxpkglist: noncsw: stop_on_hook_soft_error: exclude_pattern: gpg_homedir: root_path: deptree_filter_common: show_current: catalog_not_cached: catalog_update:" -- $cur) )
return 0
@@ -73,7 +73,7 @@ _pkgutil()
catalog_files=( "${catalog_files[@]}" "$catalog" )
done
- if [[ "$command" == @(--download|-d|--install|-i|--upgrade|-u|s|--stream) ]]; then
+ if [[ "$command" == -@([dius]|-download|-install|-upgrade|-stream) ]]; then
local packages_list=$(awk ' $0 ~ /BEGIN PGP SIGNATURE/ { exit } $1 ~ /^Hash:/ || $1 ~ /^ *(-|#|$)/ { next } { print $1 }' "${catalog_files[@]}")
COMPREPLY=( $(compgen -W "${packages_list}" -- $cur) )
diff --git a/completions/python b/completions/python
index 9c7cec1..5c5e788 100644
--- a/completions/python
+++ b/completions/python
@@ -29,8 +29,7 @@ _python()
return 0
;;
!(?(*/)python*([0-9.])|-?))
- [[ $cword -lt 2 || ${words[cword-2]} != -@(Q|W) ]] \
- && _filedir
+ [[ $cword -lt 2 || ${words[cword-2]} != -[QW] ]] && _filedir
;;
esac
diff --git a/completions/slapt-src b/completions/slapt-src
index 94ddb89..9225804 100644
--- a/completions/slapt-src
+++ b/completions/slapt-src
@@ -25,7 +25,7 @@ _slapt_src()
local i t
# search for last action (-i|-w|-b|-f)
for (( i=${#words[@]}-1; i>0; i-- )); do
- if [[ ${words[i]} == -@(i|w|f|b|-install|-show|-build|-fetch) ]]; then
+ if [[ ${words[i]} == -@([iwfb]|-install|-show|-build|-fetch) ]]; then
t="all"
break
fi
diff --git a/completions/sudo b/completions/sudo
index b13b731..04221c1 100644
--- a/completions/sudo
+++ b/completions/sudo
@@ -20,7 +20,7 @@ _sudo()
mode=edit
break
fi
- [[ ${COMP_WORDS[i]} == -@(u|U|g|C|p) ]] && ((i++))
+ [[ ${COMP_WORDS[i]} == -[uUgCp] ]] && ((i++))
done
case "$prev" in
diff --git a/completions/wget b/completions/wget
index 1fc5c95..e2e2573 100644
--- a/completions/wget
+++ b/completions/wget
@@ -100,7 +100,7 @@ _wget()
;;
-Q|--quota|--limit-rate|--warc-max-size)
# expect size
- if [[ $cur == *@(k|m) ]]; then
+ if [[ $cur == *[km] ]]; then
COMPREPLY=( $( compgen -W "$cur" ) )
elif [[ $cur ]]; then
COMPREPLY=( $( compgen -P "$cur" -W "{0..9} k m" ) )
--
bash-completion
More information about the Bash-completion-commits
mailing list