Style policy: don't use fancy globbing in case labels

This commit is contained in:
David Paleino 2009-11-22 11:43:26 +01:00
parent 1eb6c14ac1
commit 8f42adfa8d
62 changed files with 297 additions and 278 deletions

View File

@ -13,6 +13,7 @@ bash-completion (2.x)
* Added colordiff completion, same as diff * Added colordiff completion, same as diff
* contrib/cpio: added missing completions for -?, --help, --license, --usage, * contrib/cpio: added missing completions for -?, --help, --license, --usage,
--version and (-p) --to-stdout (Debian: #557436) --version and (-p) --to-stdout (Debian: #557436)
* Style policy: don't use fancy globbing in case labels
[ Ville Skyttä ] [ Ville Skyttä ]
* Create bz2 dist tarball too. * Create bz2 dist tarball too.

View File

@ -30,7 +30,7 @@ _svn()
_filedir -d _filedir -d
return 0; return 0;
;; ;;
-@(F|-file|-targets)) -F|--file|--targets)
_filedir _filedir
return 0; return 0;
;; ;;
@ -39,7 +39,7 @@ _svn()
sed -e "s@//@@;" )' -- "$cur" ) ) sed -e "s@//@@;" )' -- "$cur" ) )
return 0; return 0;
;; ;;
--@(editor|diff|diff3)-cmd) --editor-cmd|--diff-cmd|--diff3-cmd)
COMP_WORDS=(COMP_WORDS[0] $cur) COMP_WORDS=(COMP_WORDS[0] $cur)
COMP_CWORD=1 COMP_CWORD=1
_command _command
@ -57,7 +57,7 @@ _svn()
--force --targets --no-ignore \ --force --targets --no-ignore \
--non-recursive -N -q --quiet' --non-recursive -N -q --quiet'
;; ;;
@(blame|annotate|ann|praise)) blame|annotate|ann|praise)
options='-r --revisions --username \ options='-r --revisions --username \
--password --no-auth-cache \ --password --no-auth-cache \
--non-interactive -v \ --non-interactive -v \
@ -68,7 +68,7 @@ _svn()
--password --no-auth-cache \ --password --no-auth-cache \
--non-interactive' --non-interactive'
;; ;;
@(checkout|co)) checkout|co)
options='-r --revision -q --quiet -N \ options='-r --revision -q --quiet -N \
--non-recursive --username \ --non-recursive --username \
--password --no-auth-cache \ --password --no-auth-cache \
@ -78,7 +78,7 @@ _svn()
cleanup) cleanup)
options='--diff3-cmd' options='--diff3-cmd'
;; ;;
@(commit|ci)) commit|ci)
options='-m --message -F --file \ options='-m --message -F --file \
--encoding --force-log -q \ --encoding --force-log -q \
--quiet --non-recursive -N \ --quiet --non-recursive -N \
@ -87,7 +87,7 @@ _svn()
--no-auth-cache \ --no-auth-cache \
--non-interactive --no-unlock' --non-interactive --no-unlock'
;; ;;
@(copy|cp)) copy|cp)
options='-m --message -F --file \ options='-m --message -F --file \
--encoding --force-log -r \ --encoding --force-log -r \
--revision -q --quiet \ --revision -q --quiet \
@ -95,7 +95,7 @@ _svn()
--password --no-auth-cache \ --password --no-auth-cache \
--non-interactive' --non-interactive'
;; ;;
@(delete|del|remove|rm)) delete|del|remove|rm)
options='--force -m --message -F \ options='--force -m --message -F \
--file --encoding --force-log \ --file --encoding --force-log \
-q --quiet --targets \ -q --quiet --targets \
@ -103,7 +103,7 @@ _svn()
--password --no-auth-cache \ --password --no-auth-cache \
--non-interactive' --non-interactive'
;; ;;
@(diff|di)) diff|di)
options='-r --revision -x --extensions \ options='-r --revision -x --extensions \
--diff-cmd --no-diff-deleted \ --diff-cmd --no-diff-deleted \
-N --non-recursive --username \ -N --non-recursive --username \
@ -136,7 +136,7 @@ _svn()
--revision --xml --targets \ --revision --xml --targets \
-R --recursive --incremental' -R --recursive --incremental'
;; ;;
@(list|ls)) list|ls)
options='-r --revision -v --verbose -R \ options='-r --revision -v --verbose -R \
--recursive --username \ --recursive --username \
--password --no-auth-cache \ --password --no-auth-cache \
@ -175,7 +175,7 @@ _svn()
--no-auth-cache \ --no-auth-cache \
--non-interactive' --non-interactive'
;; ;;
@(move|mv|rename|ren)) move|mv|rename|ren)
options='-m --message -F --file \ options='-m --message -F --file \
--encoding --force-log -r \ --encoding --force-log -r \
--revision -q --quiet \ --revision -q --quiet \
@ -184,34 +184,34 @@ _svn()
--no-auth-cache \ --no-auth-cache \
--non-interactive' --non-interactive'
;; ;;
@(propdel|pdel|pd)) propdel|pdel|pd)
options='-q --quiet -R --recursive -r \ options='-q --quiet -R --recursive -r \
--revision --revprop \ --revision --revprop \
--username --password \ --username --password \
--no-auth-cache \ --no-auth-cache \
--non-interactive' --non-interactive'
;; ;;
@(propedit|pedit|pe)) propedit|pedit|pe)
options='-r --revision --revprop \ options='-r --revision --revprop \
--encoding --editor-cmd \ --encoding --editor-cmd \
--username --password \ --username --password \
--no-auth-cache \ --no-auth-cache \
--non-interactive --force' --non-interactive --force'
;; ;;
@(propget|pget|pg)) propget|pget|pg)
options='-R --recursive -r --revision \ options='-R --recursive -r --revision \
--revprop --strict --username \ --revprop --strict --username \
--password --no-auth-cache \ --password --no-auth-cache \
--non-interactive' --non-interactive'
;; ;;
@(proplist|plist|pl)) proplist|plist|pl)
options='-v --verbose -R --recursive \ options='-v --verbose -R --recursive \
-r --revision --revprop -q \ -r --revision --revprop -q \
--quiet --username --password \ --quiet --username --password \
--no-auth-cache \ --no-auth-cache \
--non-interactive' --non-interactive'
;; ;;
@(propset|pset|ps)) propset|pset|ps)
options='-F --file -q --quiet \ options='-F --file -q --quiet \
--targets -R --recursive \ --targets -R --recursive \
--revprop --encoding \ --revprop --encoding \
@ -226,7 +226,7 @@ _svn()
revert) revert)
options='--targets -R --recursive -q --quiet' options='--targets -R --recursive -q --quiet'
;; ;;
@(status|stat|st)) status|stat|st)
options='-u --show-updates -v \ options='-u --show-updates -v \
--verbose -N --non-recursive \ --verbose -N --non-recursive \
-q --quiet --username \ -q --quiet --username \
@ -235,7 +235,7 @@ _svn()
--ignore-externals \ --ignore-externals \
--incremental --xml' --incremental --xml'
;; ;;
@(switch|sw)) switch|sw)
options='--relocate -r --revision -N \ options='--relocate -r --revision -N \
--non-recursive -q --quiet \ --non-recursive -q --quiet \
--username --password \ --username --password \
@ -247,7 +247,7 @@ _svn()
--password --no-auth-cache \ --password --no-auth-cache \
--non-interactive' --non-interactive'
;; ;;
@(update|up)) update|up)
options='-r --revision -N \ options='-r --revision -N \
--non-recursive -q --quiet \ --non-recursive -q --quiet \
--username --password \ --username --password \
@ -374,7 +374,7 @@ _svnlook()
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
# possible options for the command # possible options for the command
case $command in case $command in
@(author|cat|date|dirs-changed|info|log)) author|cat|date|dirs-changed|info|log)
options='-r --revision -t \ options='-r --revision -t \
--transaction' --transaction'
;; ;;
@ -392,7 +392,7 @@ _svnlook()
history) history)
options='-r --revision --show-ids' options='-r --revision --show-ids'
;; ;;
prop@(get|list)) propget|proplist)
options='-r --revision -t \ options='-r --revision -t \
--transaction --revprop' --transaction --revprop'
;; ;;

View File

@ -36,11 +36,11 @@ _apt_get()
fi fi
case "$prev" in case "$prev" in
-@(c|-config-file)) -c|--config-file)
_filedir _filedir
return 0 return 0
;; ;;
-@(t|-target-release|-default-release)) -t|--target-release|--default-release)
COMPREPLY=( $( apt-cache policy | \ COMPREPLY=( $( apt-cache policy | \
grep "release.o=Debian,a=$cur" | \ grep "release.o=Debian,a=$cur" | \
sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null) ) sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null) )
@ -113,7 +113,7 @@ _apt_cache()
case "$prev" in case "$prev" in
-@(c|p|s|-config-file|-@(pkg|src)-cache)) -c|-p|-s|--config-file|--pkg-cache|--src-cache)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -17,7 +17,7 @@ _apt_build()
if [ -n "$special" ]; then if [ -n "$special" ]; then
case $special in case $special in
@(install|source|info)) install|source|info)
COMPREPLY=( $( apt-cache pkgnames "$cur" 2> /dev/null ) ) COMPREPLY=( $( apt-cache pkgnames "$cur" 2> /dev/null ) )
return 0 return 0
;; ;;
@ -32,11 +32,11 @@ _apt_build()
fi fi
case "$prev" in case "$prev" in
--@(patch|build-dir|repository-dir)) --patch|--build-dir|--repository-dir)
_filedir _filedir
return 0 return 0
;; ;;
-@(h|-help)) -h|--help)
return 0 return 0
;; ;;
esac esac

View File

@ -40,11 +40,13 @@ _aptitude()
if [[ -n "$special" ]]; then if [[ -n "$special" ]]; then
case $special in case $special in
@(install|hold|@(|un)markauto|@(dist|full)-upgrade|download|show|changelog|why@(|-not)|build-dep|@(add|remove)-user-tag)) install|hold|markauto|unmarkauto|dist-upgrade|full-upgrade| \
download|show|changelog|why|why-not|build-dep|add-user-tag| \
remove-user-tag)
COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) )
return 0 return 0
;; ;;
@(purge|remove|reinstall|forbid-version)) purge|remove|reinstall|forbid-version)
COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) ) COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
return 0 return 0
;; ;;
@ -57,14 +59,14 @@ _aptitude()
case $prev in case $prev in
# don't complete anything if these options are found # don't complete anything if these options are found
@(@(auto|)clean|forget-new|search|@(|safe-)upgrade|update|keep-all)) autoclean|clean|forget-new|search|safe-upgrade|upgrade|update|keep-all)
return 0 return 0
;; ;;
-S) -S)
_filedir _filedir
return 0 return 0
;; ;;
-@(t|-@(target|default)-release)) -t|--target-release|--default-release)
COMPREPLY=( $( apt-cache policy | \ COMPREPLY=( $( apt-cache policy | \
grep "release.o=Debian,a=$cur" | \ grep "release.o=Debian,a=$cur" | \
sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null ) ) sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null ) )

View File

@ -25,11 +25,11 @@ _aspell()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
-c|-p|check|--@(conf|personal|repl|per-conf)) -c|-p|check|--conf|--personal|--repl|--per-conf)
_filedir _filedir
return 0 return 0
;; ;;
--@(conf-dir|data-dir|dict-dir|home-dir|local-data-dir|prefix)) --conf-dir|--data-dir|--dict-dir|--home-dir|--local-data-dir|--prefix)
_filedir -d _filedir -d
return 0 return 0
;; ;;

View File

@ -103,7 +103,7 @@ _complete()
COMPREPLY=( $( compgen -A function -- "$cur" ) ) COMPREPLY=( $( compgen -A function -- "$cur" ) )
return 0 return 0
;; ;;
-@(p|r)) -p|-r)
COMPREPLY=( $( complete -p | sed -e 's|.* ||' ) ) COMPREPLY=( $( complete -p | sed -e 's|.* ||' ) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
return 0 return 0

View File

@ -11,7 +11,7 @@ _btdownload()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
--@(responsefile|saveas)) --responsefile|--saveas)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -79,7 +79,7 @@ _hcitool()
fi fi
else else
case $command in case $command in
@(name|info|dc|rssi|lq|afh|auth|key|clkoff|lst)) name|info|dc|rssi|lq|afh|auth|key|clkoff|lst)
_count_args _count_args
if [ $args -eq 2 ]; then if [ $args -eq 2 ]; then
_bluetooth_adresses _bluetooth_adresses
@ -111,7 +111,7 @@ _hcitool()
_bluetooth_packet_types _bluetooth_packet_types
fi fi
;; ;;
@(tpl|enc|clock)) tpl|enc|clock)
_count_args _count_args
if [ $args -eq 2 ]; then if [ $args -eq 2 ]; then
_bluetooth_adresses _bluetooth_adresses
@ -161,7 +161,7 @@ _sdptool()
_bluetooth_services _bluetooth_services
fi fi
;; ;;
@(browse|records)) browse|records)
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--tree --raw --xml' -- "$cur" ) ) COMPREPLY=( $( compgen -W '--tree --raw --xml' -- "$cur" ) )
else else
@ -219,7 +219,7 @@ _rfcomm()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-@(f|-config)) -f|--config)
_filedir _filedir
return 0; return 0;
;; ;;
@ -245,7 +245,7 @@ _rfcomm()
_bluetooth_devices _bluetooth_devices
else else
case $command in case $command in
@(connect|bind)) connect|bind)
if [ $args -eq 3 ]; then if [ $args -eq 3 ]; then
_bluetooth_adresses _bluetooth_adresses
fi fi
@ -282,7 +282,7 @@ _ciptool()
fi fi
else else
case $command in case $command in
@(connect|release|loopback)) connect|release|loopback)
_count_args _count_args
if [ $args -eq 2 ]; then if [ $args -eq 2 ]; then
_bluetooth_adresses _bluetooth_adresses
@ -347,7 +347,7 @@ _hciconfig()
fi fi
else else
case $command in case $command in
@(putkey|delkey)) putkey|delkey)
_count_args _count_args
if [ $args -eq 2 ]; then if [ $args -eq 2 ]; then
_bluetooth_adresses _bluetooth_adresses

View File

@ -27,7 +27,7 @@ _brctl()
;; ;;
3) 3)
case $command in case $command in
@(add|del)if) addif|delif)
_configured_interfaces _configured_interfaces
;; ;;
stp) stp)

View File

@ -24,7 +24,7 @@ _cfagent()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-@(f|-file)) -f|--file)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -12,7 +12,7 @@ _chkconfig()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
@(?(--level=)[1-6]|--@(list|add|del|override))) --level=[1-6]|[1-6]|--list|--add|--del|--override)
_services _services
return 0 return 0
;; ;;

View File

@ -17,7 +17,7 @@ _cpan2dist()
-- "$cur" ) ) -- "$cur" ) )
return 0 return 0
;; ;;
--@(banlist|ignorelist|modulelist|logfile)) --banlist|--ignorelist|--modulelist|--logfile)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -69,58 +69,58 @@ _cvs()
mode=cvsroot mode=cvsroot
cvsroot=${COMP_WORDS[((count+1))]} cvsroot=${COMP_WORDS[((count+1))]}
;; ;;
@(ad?(d)|new)) ad|add|new)
mode=add mode=add
;; ;;
@(adm?(in)|rcs)) adm|admin|rcs)
mode=admin mode=admin
;; ;;
ann?(otate)) ann|annotate)
mode=annotate mode=annotate
;; ;;
@(checkout|co|get)) checkout|co|get)
mode=checkout mode=checkout
;; ;;
@(com?(mit)|ci)) com|commit|ci)
mode=commit mode=commit
;; ;;
di?(f?(f))) di|dif|diff)
mode=diff mode=diff
;; ;;
ex?(p?(ort))) ex|exp|export)
mode=export mode=export
;; ;;
?(un)edit) edit|unedit)
mode=$i mode=$i
;; ;;
hi?(s?(tory))) hi|his|history)
mode=history mode=history
;; ;;
im?(p?(ort))) im|imp|import)
mode=import mode=import
;; ;;
re?(l?(ease))) re|rel|release)
mode=release mode=release
;; ;;
?(r)log) log|rlog)
mode=log mode=log
;; ;;
@(rdiff|patch)) rdiff|patch)
mode=rdiff mode=rdiff
;; ;;
@(remove|rm|delete)) remove|rm|delete)
mode=remove mode=remove
;; ;;
@(rtag|rfreeze)) rtag|rfreeze)
mode=rtag mode=rtag
;; ;;
st?(at?(us))) st|stat|status)
mode=status mode=status
;; ;;
@(tag|freeze)) tag|freeze)
mode=tag mode=tag
;; ;;
up?(d?(ate))) up|upd|update)
mode=update mode=update
;; ;;
esac esac

View File

@ -9,7 +9,7 @@ have dhclient && _dhclient()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(cf|lf|pf|sf)) -cf|-lf|-pf|-sf)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -18,17 +18,17 @@ _dict()
for (( i=1; i < COMP_CWORD; i++ )); do for (( i=1; i < COMP_CWORD; i++ )); do
case "${COMP_WORDS[i]}" in case "${COMP_WORDS[i]}" in
-@(h|--host)) -h|--host)
host=${COMP_WORDS[i+1]} host=${COMP_WORDS[i+1]}
[ -n "$host" ] && host="-h $host" [ -n "$host" ] && host="-h $host"
i=$((++i)) i=$((++i))
;; ;;
-@(p|-port)) -p|--port)
port=${COMP_WORDS[i+1]} port=${COMP_WORDS[i+1]}
[ -n "$port" ] && port="-p $port" [ -n "$port" ] && port="-p $port"
i=$((++i)) i=$((++i))
;; ;;
-@(d|-database)) -d|--database)
db=${COMP_WORDS[i+1]} db=${COMP_WORDS[i+1]}
[ -n "$db" ] && host="-d $db" [ -n "$db" ] && host="-d $db"
i=$((++i)) i=$((++i))
@ -51,11 +51,11 @@ _dict()
fi fi
case "$prev" in case "$prev" in
-@(d|-database|i|info)) -d|--database|-i|-info)
COMPREPLY=( $( compgen -W '$( _dictdata -D )' -- "$cur" ) ) COMPREPLY=( $( compgen -W '$( _dictdata -D )' -- "$cur" ) )
return 0 return 0
;; ;;
-@(s|-strategy)) -s|--strategy)
COMPREPLY=( $( compgen -W '$( _dictdata -S )' -- "$cur" ) ) COMPREPLY=( $( compgen -W '$( _dictdata -S )' -- "$cur" ) )
return 0 return 0
;; ;;

View File

@ -40,23 +40,25 @@ _dpkg()
fi fi
case "$prev" in case "$prev" in
-@(c|i|A|I|f|e|x|X|W|-@(install|unpack|record-avail|contents|info|fsys-tarfile|field|control|extract|show))) -c|-i|-A|-I|-f|-e|-x|-X|-W|--install|--unpack|--record-avail| \
--contents|--info|--fsys-tarfile|--field|--control|--extract| \
--show)
_filedir '?(u)deb' _filedir '?(u)deb'
return 0 return 0
;; ;;
-@(b|-build)) -b|--build)
_filedir -d _filedir -d
return 0 return 0
;; ;;
-@(s|p|l|-@(status|print-avail|list))) -s|-p|-l|--status|--print-avail|--list)
COMPREPLY=( $( apt-cache pkgnames "$cur" 2>/dev/null ) ) COMPREPLY=( $( apt-cache pkgnames "$cur" 2>/dev/null ) )
return 0 return 0
;; ;;
-@(S|-search)) -S|--search)
_filedir _filedir
return 0 return 0
;; ;;
-@(r|L|P|-@(remove|purge|listfiles))) -r|-L|-P|--remove|--purge|--listfiles)
COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) ) COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
return 0 return 0
;; ;;
@ -107,14 +109,14 @@ _dpkg_reconfigure()
case "$prev" in case "$prev" in
-@(f|-frontend)) -f|--frontend)
opt=( $( echo /usr/share/perl5/Debconf/FrontEnd/* ) ) opt=( $( echo /usr/share/perl5/Debconf/FrontEnd/* ) )
opt=( ${opt[@]##*/} ) opt=( ${opt[@]##*/} )
opt=( ${opt[@]%.pm} ) opt=( ${opt[@]%.pm} )
COMPREPLY=( $( compgen -W '${opt[@]}' -- "$cur" ) ) COMPREPLY=( $( compgen -W '${opt[@]}' -- "$cur" ) )
return 0 return 0
;; ;;
-@(p|-priority)) -p|--priority)
COMPREPLY=( $( compgen -W 'low medium high critical' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'low medium high critical' -- "$cur" ) )
return 0 return 0
;; ;;

View File

@ -14,7 +14,7 @@ _dselect()
_filedir -d _filedir -d
return 0 return 0
;; ;;
-@(D|debug)) -D|-debug)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -72,7 +72,7 @@ _dsniff()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(r|w|f)) -r|-w|-f)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -12,11 +12,12 @@ _find()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(max|min)depth) -maxdepth|-mindepth)
COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) ) COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) )
return 0 return 0
;; ;;
-?(a|c)newer|-fls|-fprint?(0|f)|-?(i)?(l)name|-?(i)wholename) -newer|-anewer|-cnewer|-fls|-fprint|-fprint0|-fprintf|-name|-iname| \
-lname|-ilname|-wholename|-iwholename)
_filedir _filedir
return 0 return 0
;; ;;
@ -35,7 +36,7 @@ _find()
COMPREPLY=( $( compgen -g -- "$cur" 2>/dev/null) ) COMPREPLY=( $( compgen -g -- "$cur" 2>/dev/null) )
return 0 return 0
;; ;;
-?(x)type) -xtype|-type)
COMPREPLY=( $( compgen -W 'b c d p f l s' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'b c d p f l s' -- "$cur" ) )
return 0 return 0
;; ;;
@ -53,8 +54,9 @@ _find()
_command _command
return 0 return 0
;; ;;
-[acm]min|-[acm]time|-?(i)?(l)?(whole)name|-inum|-?(i)path|-?(i)regex| \ -[acm]min|-[acm]time|-iname|-lname|-wholename|-iwholename|-lwholename| \
-links|-perm|-size|-used|-printf) -ilwholename|-inum|-path|-ipath|-regex|-iregex|-links|-perm|-size| \
-used|-printf)
# do nothing, just wait for a parameter to be given # do nothing, just wait for a parameter to be given
return 0 return 0
;; ;;

View File

@ -10,7 +10,7 @@ _civserver()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(f|g|l|r|-file|-log|-gamelog|-read)) -f|-g|-l|-r|--file|--log|--gamelog|--read)
_filedir _filedir
return 0 return 0
;; ;;
@ -37,15 +37,15 @@ _civclient()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(l|S|t|-log|-Sound|-tiles)) -l|-S|-t|--log|--Sound|--tiles)
_filedir _filedir
return 0 return 0
;; ;;
-@(P|-Plugin)) -P|--Plugin)
COMPREPLY=( $( compgen -W 'none esd sdl' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'none esd sdl' -- "$cur" ) )
return 0 return 0
;; ;;
-@(s|-server)) -s|--server)
_known_hosts_real "$cur" _known_hosts_real "$cur"
return 0 return 0
;; ;;

View File

@ -10,7 +10,8 @@ _mkisofs()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(o|abstract|biblio|check-session|copyright|log-file|root-info|prep-boot|*-list)) -o|-abstract|-biblio|-check-session|-copyright|-log-file| \
-root-info|-prep-boot|-*-list)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -10,18 +10,18 @@ _gpg()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(s|-sign|-clearsign|-decrypt-files|-load-extension)) -s|--sign|--clearsign|--decrypt-files|--load-extension)
_filedir _filedir
return 0 return 0
;; ;;
--@(export|@(?(l|nr|nrl)sign|edit)-key)) --export|--sign-key|--lsignkey|--nrsignkey|--nrlsignkey|--editkey)
# return list of public keys # return list of public keys
COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \ COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \
sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \ sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \
-ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) -ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) )
return 0 return 0
;; ;;
-@(r|-recipient)) -r|--recipient)
COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \ COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \
sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" )) sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ))
if [ -e ~/.gnupg/gpg.conf ]; then if [ -e ~/.gnupg/gpg.conf ]; then

View File

@ -14,18 +14,18 @@ _gpg2 ()
_filedir -d _filedir -d
return 0 return 0
;; ;;
-@(s|-sign|-clearsign|-options|-decrypt)) -s|--sign|--clearsign|--options|--decrypt)
_filedir _filedir
return 0 return 0
;; ;;
--@(export|@(?(l|nr|nrl)sign|edit)-key)) --export|--sign-key|--lsign-key|--nrsign-key|--nrlsign-key|--edit-key)
# return list of public keys # return list of public keys
COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \ COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \
sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \ sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \
-ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) -ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) )
return 0 return 0
;; ;;
-@(r|-recipient)) -r|--recipient)
COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \ COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \
sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" )) sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ))
if [ -e ~/.gnupg/gpg.conf ]; then if [ -e ~/.gnupg/gpg.conf ]; then

View File

@ -50,7 +50,7 @@ _ktutil()
_heimdal_realms _heimdal_realms
return 0 return 0
;; ;;
-@(s|k|-@(srv|key)tab)) -s|-k|--srvtab|--keytab)
_filedir _filedir
return 0 return 0
;; ;;
@ -63,7 +63,7 @@ _ktutil()
for (( i=1; i < COMP_CWORD; i++ )); do for (( i=1; i < COMP_CWORD; i++ )); do
case ${COMP_WORDS[i]} in case ${COMP_WORDS[i]} in
-@(k|-keytab)) -k|--keytab)
i=$(($i+1)) i=$(($i+1))
;; ;;
-*) -*)
@ -97,7 +97,7 @@ _ktutil()
purge) purge)
options='--age' options='--age'
;; ;;
@(srv2keytab|key2srvtab)) srv2keytab|key2srvtab)
options='-s --srvtab' options='-s --srvtab'
;; ;;
*) *)

View File

@ -10,7 +10,7 @@ _iconv()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(f|t|-@(from|to)-code)) -f|-t|--from-code|--to-code)
COMPREPLY=( $( compgen -W \ COMPREPLY=( $( compgen -W \
'$( iconv --list | sed -e "s@//@@;" )' -- "$cur" ) ) '$( iconv --list | sed -e "s@//@@;" )' -- "$cur" ) )
return 0 return 0

View File

@ -103,7 +103,7 @@ _ImageMagick()
Wave OilPaint CharcoalDrawing JPEG' -- "$cur" ) ) Wave OilPaint CharcoalDrawing JPEG' -- "$cur" ) )
return 0 return 0
;; ;;
-@(mask|profile|texture|tile|write)) -mask|-profile|-texture|-tile|-write)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -142,7 +142,7 @@ _java()
done done
case $prev in case $prev in
-@(cp|classpath)) -cp|-classpath)
_java_path _java_path
return 0 return 0
;; ;;
@ -179,7 +179,7 @@ _javadoc()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-@(overview|helpfile|stylesheetfile)) -overview|-helpfile|-stylesheetfile)
_filedir _filedir
return 0 return 0
;; ;;
@ -187,7 +187,7 @@ _javadoc()
_filedir -d _filedir -d
return 0 return 0
;; ;;
-@(classpath|bootclasspath|docletpath|sourcepath|extdirs)) -classpath|-bootclasspath|-docletpath|-sourcepath|-extdirs)
_java_path _java_path
return 0 return 0
;; ;;
@ -231,7 +231,7 @@ _javac()
_filedir -d _filedir -d
return 0 return 0
;; ;;
-@(classpath|bootclasspath|sourcepath|extdirs)) -classpath|-bootclasspath|-sourcepath|-extdirs)
_java_path _java_path
return 0 return 0
;; ;;

View File

@ -10,11 +10,11 @@ _ldapvi()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(h|-host)) -h|--host)
_known_hosts_real "$cur" _known_hosts_real "$cur"
return 0 return 0
;; ;;
-@(Y|-sasl-mech)) -Y|--sasl-mech)
COMPREPLY=( $( compgen -W 'EXTERNAL GSSAPI DIGEST-MD5 \ COMPREPLY=( $( compgen -W 'EXTERNAL GSSAPI DIGEST-MD5 \
CRAM-MD5 PLAIN ANONYMOUS' -- "$cur" ) ) CRAM-MD5 PLAIN ANONYMOUS' -- "$cur" ) )
return 0 return 0

View File

@ -16,7 +16,7 @@ _lilo()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-@(C|i|m|s|S)) -C|-i|-m|-s|-S)
_filedir _filedir
return 0 return 0
;; ;;
@ -24,12 +24,12 @@ _lilo()
_filedir -d _filedir -d
return 0 return 0
;; ;;
-@(I|D|R)) -I|-D|-R)
# label completion # label completion
_lilo_labels _lilo_labels
return 0 return 0
;; ;;
-@(A|b|M|u|U)) -A|-b|-M|-u|-U)
# device completion # device completion
cur=${cur:=/dev/} cur=${cur:=/dev/}
_filedir _filedir

View File

@ -82,7 +82,7 @@ _pvs()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(o|O|-options|-sort)) -o|-O|--options|--sort)
COMPREPLY=( $( compgen -W 'pv_fmt pv_uuid \ COMPREPLY=( $( compgen -W 'pv_fmt pv_uuid \
pv_size pv_free pv_used pv_name \ pv_size pv_free pv_used pv_name \
pv_attr pv_pe_count \ pv_attr pv_pe_count \
@ -139,7 +139,7 @@ _pvchange()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|x|-autobackup|--allocatable)) -A|-x|--autobackup|--allocatable)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
@ -169,7 +169,7 @@ _pvcreate()
_filedir _filedir
return 0 return 0
;; ;;
-@(M|-metadatatype)) -M|--metadatatype)
COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) )
return 0 return 0
;; ;;
@ -177,7 +177,7 @@ _pvcreate()
COMPREPLY=( $( compgen -W '0 1 2' -- "$cur" ) ) COMPREPLY=( $( compgen -W '0 1 2' -- "$cur" ) )
return 0 return 0
;; ;;
--@(metadatasize|setphysicalvolumesize)) --metadatasize|--setphysicalvolumesize)
_sizes _sizes
return 0 return 0
;; ;;
@ -204,11 +204,11 @@ _pvmove()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|-autobackup)) -A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
-@(n|-name)) -n|--name)
_logicalvolumes _logicalvolumes
return 0 return 0
esac esac
@ -263,7 +263,7 @@ _vgs()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(o|O|-options|-sort)) -o|-O|--options|--sort)
COMPREPLY=( $( compgen -W 'vg_fmt vg_uuid vg_name \ COMPREPLY=( $( compgen -W 'vg_fmt vg_uuid vg_name \
vg_attr vg_size vg_free vg_sysid \ vg_attr vg_size vg_free vg_sysid \
vg_extent_size vg_extent_count vg_free_count \ vg_extent_size vg_extent_count vg_free_count \
@ -323,7 +323,7 @@ _vgchange()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(a|A|x|-available|-autobackup|-resizeable)) -a|-A|-x|--available|--autobackup|--resizeable)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
@ -350,15 +350,15 @@ _vgcreate()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|-autobackup)) -A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
-@(M|-metadatatype)) -M|--metadatatype)
COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) )
return 0 return 0
;; ;;
-@(s|-physicalextentsize)) -s|--physicalextentsize)
_sizes _sizes
return 0 return 0
;; ;;
@ -405,7 +405,7 @@ _vgrename()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|-autobackup)) -A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
@ -429,7 +429,7 @@ _vgreduce()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|-autobackup)) -A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
@ -460,11 +460,11 @@ _vgextend()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|-autobackup)) -A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
-@(L|-size)) -L|--size)
_sizes _sizes
return 0 return 0
;; ;;
@ -525,7 +525,7 @@ _vgconvert()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(M|-metadatatype)) -M|--metadatatype)
COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) )
return 0 return 0
;; ;;
@ -558,7 +558,7 @@ _vgcfgbackup()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(f|-file)) -f|--file)
_filedir _filedir
return 0 return 0
;; ;;
@ -583,15 +583,15 @@ _vgcfgrestore()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(f|-file)) -f|--file)
_filedir _filedir
return 0 return 0
;; ;;
-@(M|-metadatatype)) -M|--metadatatype)
COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) )
return 0 return 0
;; ;;
-@(n|-name)) -n|--name)
_volumegroups _volumegroups
return 0 return 0
;; ;;
@ -616,7 +616,7 @@ _vgmerge()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|-autobackup)) -A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
@ -640,11 +640,11 @@ _vgsplit()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|-autobackup)) -A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
-@(M|-metadatatype)) -M|--metadatatype)
COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) )
return 0 return 0
;; ;;
@ -705,7 +705,7 @@ _lvs()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(o|O|-options|-sort)) -o|-O|--options|--sort)
COMPREPLY=( $( compgen -W 'lv_uuid lv_name lv_attr lv_minor \ COMPREPLY=( $( compgen -W 'lv_uuid lv_name lv_attr lv_minor \
lv_size seg_count origin snap_percent segtype stripes \ lv_size seg_count origin snap_percent segtype stripes \
stripesize chunksize seg_start seg_size' -- "$cur" ) ) stripesize chunksize seg_start seg_size' -- "$cur" ) )
@ -761,11 +761,11 @@ _lvchange()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(a|A|C|M|-available|-autobackup|-continguous|-persistent)) -a|-A|-C|-M|--available|--autobackup|--continguous|--persistent)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
-@(p|-permission)) -p|--permission)
COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) )
return 0 return 0
;; ;;
@ -793,19 +793,19 @@ _lvcreate()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|C|M|Z|-autobackup|-continguous|-persistent|-zero)) -A|-C|-M|-Z|--autobackup|--continguous|--persistent|--zero)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
-@(L|-size)) -L|--size)
_sizes _sizes
return 0 return 0
;; ;;
-@(p|-permission)) -p|--permission)
COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) )
return 0 return 0
;; ;;
-@(n|-name)) -n|--name)
_logicalvolumes _logicalvolumes
return 0 return 0
;; ;;
@ -838,7 +838,7 @@ _lvremove()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|-autobackup)) -A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
@ -862,7 +862,7 @@ _lvrename()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|-autobackup)) -A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
@ -886,11 +886,11 @@ _lvreduce()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|-autobackup)) -A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
-@(L|-size)) -L|--size)
_sizes _sizes
return 0 return 0
;; ;;
@ -915,11 +915,11 @@ _lvresize()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|-autobackup)) -A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
-@(L|-size)) -L|--size)
_sizes _sizes
return 0 return 0
;; ;;
@ -950,11 +950,11 @@ _lvextend()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(A|-autobackup)) -A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0 return 0
;; ;;
-@(L|-size)) -L|--size)
_sizes _sizes
return 0 return 0
;; ;;

View File

@ -36,7 +36,7 @@ _lzop()
xspec="*.?(t)lzo" xspec="*.?(t)lzo"
case "$prev" in case "$prev" in
--@(@(de|un)compress|extract|list|ls|info|test)) --decompress|--uncompress|--extract|--list|--ls|--info|--test)
xspec="!"$xspec xspec="!"$xspec
;; ;;
--force) --force)

View File

@ -34,11 +34,11 @@ _add_members()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
-@(r|d|-regular-members-file|-digest-members-file)) -r|-d|--regular-members-file|--digest-members-file)
_filedir _filedir
return 0 return 0
;; ;;
-@(w|a|-welcome-msg|-admin-notify)) -w|-a|--welcome-msg|--admin-notify)
COMPREPLY=( $( compgen -W 'y n' -- "$cur") ) COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
return 0 return 0
;; ;;
@ -69,7 +69,7 @@ _remove_members()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
-@(f|-file)) -f|--file)
_filedir _filedir
return 0 return 0
;; ;;
@ -99,7 +99,7 @@ _find_member()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
-@(l|x|-listname|-exclude)) -l|-x|--listname|--exclude)
_mailman_lists _mailman_lists
return 0 return 0
;; ;;
@ -127,7 +127,7 @@ _clone_member()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
-@(l|-listname)) -l|--listname)
_mailman_lists _mailman_lists
return 0 return 0
;; ;;
@ -155,7 +155,7 @@ _sync_members()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
-@(w|g|d|--welcome-msg|-goodbye-msg|-digest)) -w|-g|-d|--welcome-msg|--goodbye-msg|--digest)
COMPREPLY=( $( compgen -W 'y n' -- "$cur") ) COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
return 0 return 0
;; ;;
@ -241,15 +241,15 @@ _list_members()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
-@(o|-output)) -o|--output)
_filedir _filedir
return 0 return 0
;; ;;
-@(d|-digest)) -d|--digest)
COMPREPLY=( $( compgen -W 'mime plain' -- "$cur") ) COMPREPLY=( $( compgen -W 'mime plain' -- "$cur") )
return 0 return 0
;; ;;
-@(n|-nomail)) -n|--nomail)
COMPREPLY=( $( compgen -W 'byadmin byuser bybounce unknown' \ COMPREPLY=( $( compgen -W 'byadmin byuser bybounce unknown' \
-- "$cur") ) -- "$cur") )
return 0 return 0
@ -280,7 +280,7 @@ _change_pw()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
-@(l|-listname)) -l|--listname)
_mailman_lists _mailman_lists
return 0 return 0
;; ;;
@ -360,7 +360,7 @@ _config_list()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
-@(i|o|-inputfile|-outputfile)) -i|-o|--inputfile|--outputfile)
_filedir _filedir
return 0 return 0
;; ;;
@ -390,7 +390,7 @@ _arch()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
-@(w|g|d|--welcome-msg|-goodbye-msg|-digest)) -w|-g|-d|--welcome-msg|--goodbye-msg|--digest)
COMPREPLY=( $( compgen -W 'y n' -- "$cur") ) COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
return 0 return 0
;; ;;
@ -453,7 +453,7 @@ _inject()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
-@(l|-listname)) -l|--listname)
_mailman_lists _mailman_lists
return 0 return 0
;; ;;

View File

@ -12,7 +12,7 @@ _make()
_split_longopt && split=true _split_longopt && split=true
case $prev in case $prev in
-@(f|o|W|-@(?(make|old-|new-)file|assume-@(old|new)|what-if))) -f|-o|-W|--file|--makefile|--old-file|--new-file|--assume-old|--assume-new|--what-if)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -10,39 +10,39 @@ _mcrypt()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(g|-openpgp-z)) -g|--openpgp-z)
COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) ) COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) )
return 0 return 0
;; ;;
-@(o|-keymode)) -o|--keymode)
COMPREPLY=( $( compgen -W '$( mcrypt --list-keymodes \ COMPREPLY=( $( compgen -W '$( mcrypt --list-keymodes \
2>/dev/null )' -- "$cur" ) ) 2>/dev/null )' -- "$cur" ) )
return 0 return 0
;; ;;
-@(m|-mode)) -m|--mode)
COMPREPLY=( $( compgen -W "$( mcrypt --list \ COMPREPLY=( $( compgen -W "$( mcrypt --list \
2>/dev/null | sed -e 's/.*: //' -e 's/ $//' | \ 2>/dev/null | sed -e 's/.*: //' -e 's/ $//' | \
sort | uniq )" -- "$cur" ) ) sort | uniq )" -- "$cur" ) )
return 0 return 0
;; ;;
-@(a|-algorithm)) -a|--algorithm)
COMPREPLY=( $( compgen -W "$( mcrypt --list 2>/dev/null | \ COMPREPLY=( $( compgen -W "$( mcrypt --list 2>/dev/null | \
awk '{print $1}' )" -- "$cur" ) ) awk '{print $1}' )" -- "$cur" ) )
return 0 return 0
;; ;;
-@(h|-hash)) -h|--hash)
COMPREPLY=( $( compgen -W '$( mcrypt --list-hash 2>/dev/null | \ COMPREPLY=( $( compgen -W '$( mcrypt --list-hash 2>/dev/null | \
sed -e 1d )' -- "$cur" ) ) sed -e 1d )' -- "$cur" ) )
return 0 return 0
;; ;;
-@(k|s|-@(key?(size)))) -k|-s|--key|--keysize)
return 0 return 0
;; ;;
-@(f|c|-@(keyfile|config))) -f|-c|--keyfile|--config)
_filedir _filedir
return 0 return 0
;; ;;
--@(algorithm|mode)s-directory) --algorithms-directory|--modes-directory)
_filedir -d _filedir -d
return 0 return 0
;; ;;

View File

@ -8,11 +8,11 @@ _mdadm_raid_level()
for (( i=1; i < COMP_CWORD; i++ )); do for (( i=1; i < COMP_CWORD; i++ )); do
case ${COMP_WORDS[i]} in case ${COMP_WORDS[i]} in
-@(C|-create)) -C|--create)
mode=create mode=create
break break
;; ;;
-@(B|-build)) -B|--build)
mode=build mode=build
break break
;; ;;
@ -114,13 +114,13 @@ _mdadm()
--create --monitor --grow" -- "$cur" ) ) --create --monitor --grow" -- "$cur" ) )
else else
case ${COMP_WORDS[COMP_CWORD-1]} in case ${COMP_WORDS[COMP_CWORD-1]} in
-@(A|-assemble)) -A|--assemble)
COMPREPLY=( $( compgen -W "$options --uuid \ COMPREPLY=( $( compgen -W "$options --uuid \
--super-minor --name --force --run \ --super-minor --name --force --run \
--no-degraded --auto --bitmap --backup-file \ --no-degraded --auto --bitmap --backup-file \
--update --auto-update-homehost" -- "$cur" ) ) --update --auto-update-homehost" -- "$cur" ) )
;; ;;
-@(B|C|G|-build|-create|-grow)) -B|-C|-G|--build|--create|--grow)
COMPREPLY=( $( compgen -W "$options --raid-devices \ COMPREPLY=( $( compgen -W "$options --raid-devices \
--spare-devices --size --chunk --rounding \ --spare-devices --size --chunk --rounding \
--level --layout --parity --bitmap \ --level --layout --parity --bitmap \
@ -128,13 +128,13 @@ _mdadm()
--assume-clean --backup-file --name --run \ --assume-clean --backup-file --name --run \
--force --auto" -- "$cur" ) ) --force --auto" -- "$cur" ) )
;; ;;
-@(F|-follow|-monitor)) -F|--follow|--monitor)
COMPREPLY=( $( compgen -W "$options --mail --program \ COMPREPLY=( $( compgen -W "$options --mail --program \
--alert --syslog --delay --daemonise \ --alert --syslog --delay --daemonise \
--pid-file --oneshot --test" -- "$cur" ) ) --pid-file --oneshot --test" -- "$cur" ) )
;; ;;
@(/dev/*|--add|--fail|--remove)) /dev/*|--add|--fail|--remove)
COMPREPLY=( $( compgen -W "$options --add --re-add \ COMPREPLY=( $( compgen -W "$options --add --re-add \
--remove --fail --set-faulty" -- "$cur" ) ) --remove --fail --set-faulty" -- "$cur" ) )
;; ;;

View File

@ -10,11 +10,11 @@ _minicom()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-@(a|c)) -a|-c)
COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
return 0 return 0
;; ;;
-@(S|C)) -S|-C)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -12,11 +12,11 @@ _mkinitrd()
_split_longopt && split=true _split_longopt && split=true
case "$prev" in case "$prev" in
--@(preload|with|builtin)) --preload|--with|--builtin)
_modules _modules
return 0 return 0
;; ;;
--@(fstab|dsdt)) --fstab|--dsdt)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -25,7 +25,7 @@ _mock()
_split_longopt && split=true _split_longopt && split=true
case $prev in case $prev in
-@(h|-help|-copy@(in|out)|-arch|D|-define|-with?(out)|-uniqueext|-rpmbuild_timeout|-sources|-cwd)) -h|--help|--copyin|--copyout|--arch|-D|--define|--with|--without|--uniqueext|--rpmbuild_timeout|--sources|--cwd)
return 0 return 0
;; ;;
-r|--root) -r|--root)
@ -33,7 +33,7 @@ _mock()
COMPREPLY=( ${COMPREPLY[@]/%.cfg/} ) COMPREPLY=( ${COMPREPLY[@]/%.cfg/} )
return 0 return 0
;; ;;
--@(config|result)dir) --configdir|--resultdir)
_filedir -d _filedir -d
return 0 return 0
;; ;;
@ -51,7 +51,7 @@ _mock()
-- "$cur" ) ) -- "$cur" ) )
return 0 return 0
;; ;;
--@(en|dis)able-plugin) --enable-plugin|--disable-plugin)
COMPREPLY=( $( compgen -W "$plugins" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$plugins" -- "$cur" ) )
return 0 return 0
;; ;;

View File

@ -59,10 +59,10 @@ _module ()
elif [ $COMP_CWORD -eq 2 ] ; then elif [ $COMP_CWORD -eq 2 ] ; then
case "$prev" in case "$prev" in
@(add|display|help|load|show|whatis)) add|display|help|load|show|whatis)
COMPREPLY=( $(_module_avail "$cur") ) COMPREPLY=( $(_module_avail "$cur") )
;; ;;
@(rm|switch|swap|unload|update)) rm|switch|swap|unload|update)
COMPREPLY=( $(_module_list "$cur") ) COMPREPLY=( $(_module_list "$cur") )
;; ;;
unuse) unuse)
@ -71,7 +71,7 @@ _module ()
esac esac
elif [ $COMP_CWORD -eq 3 ] ; then elif [ $COMP_CWORD -eq 3 ] ; then
case ${COMP_WORDS[1]} in case ${COMP_WORDS[1]} in
@(sw?(ap|itch))) swap|switch)
COMPREPLY=( $(_module_avail "$cur") ) COMPREPLY=( $(_module_avail "$cur") )
;; ;;
esac esac

View File

@ -19,7 +19,7 @@ _mplayer()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@([av][cfo]|[av]fm|vop|fstype|demuxer|o[av]c|of|profile)) -[av][cfo]|-[av]fm|-vop|-fstype|-demuxer|-o[av]c|-of|-profile)
_mplayer_options_list $cmd $prev _mplayer_options_list $cmd $prev
return 0 return 0
;; ;;
@ -86,30 +86,33 @@ _mplayer()
_dvd_devices _dvd_devices
return 0 return 0
;; ;;
-@(mixer|dvdauth|fb|zrdev)) -mixer|-dvdauth|-fb|-zrdev)
cur=${cur:=/dev/} cur=${cur:=/dev/}
_filedir _filedir
return 0 return 0
;; ;;
-@(edl?(out)|lircconf|menu-cfg|playlist|csslib|dumpfile)| \ -edl|-edlout|-lircconf|-menu-cfg|-playlist|-csslib|-dumpfile| \
-@(subfile|vobsub|aofile|fbmodeconfig|include|o|dvdkey)| \ -subfile|-vobsub|-aofile|-fbmodeconfig|-include|-o|-dvdkey| \
-passlogfile) -passlogfile)
_filedir _filedir
return 0 return 0
;; ;;
-@(auto@(q|sync)|loop|menu-root|speed|sstep|aid|alang)| \ -autoq|-autosync|-loop|-menu-root|-speed|-sstep|-aid|-alang| \
-@(?(@(audio|sub)-)demuxer|bandwidth|cache|chapter)| \ -audo-demuxer|-sub-demuxer|-demuxer|-bandwidth|-cache|-chapter| \
-@(dvd?(angle)|fps|frames|mc|passwd|user|sb|srate|ss|vcd)| \ -dvd|-dvdangle|-fps|-frames|-mc|-passwd|-user|-sb|-srate|-ss|-vcd| \
-@(vi?(d|vo)|ffactor|sid|slang|spu@(align|aa|gauss))| \ -vi|-vid|-vivo|-ffactor|-sid|-slang|-spualign|-spuaa|-spugauss| \
-@(vobsubid|delay|bpp|brightness|contrast|dfbopts|display)| \ -vobsubid|-delay|-bpp|-brightness|-contrast|-dfbopts|-display| \
-@(fbmode|geometry|guiwid|hue|icelayer|screen[wh]|wid)| \ -fbmode|-geometry|-guiwid|-hue|-icelayer|-screen[wh]|-wid| \
-@(monitor@(aspect|-@(dotclock|[hv]freq))|panscan|saturation)| \ -monitoraspect|-monitor-dotclock|-monitor-[hv]freq|-panscan| \
-@(xineramascreen|zr@(crop|norm|quality|[xy]doff|[vh]dec))| \ -saturation|-xineramascreen|-zrcrop|-zrnorm|-zrquality| \
-@(aspect|pp|x|y|xy|z|stereo|audio-@(density|delay|preload))| \ -zr[xy]doff|-zr[vh]dec|-aspect|-pp|-x|-y|-xy|-z|-stereo| \
-@(endpos|osdlevel|ffourcc|sws|channels|skiplimit|format)| \ -audio-density|-audio-delay|-audio-preload|-endpos|-osdlevel| \
-@(ofps|aa@(driver|@(osd|sub)color)|vobsubout?(i@(ndex|d)))| \ -ffourcc|-sws|-channels|-skiplimit|-format|-ofps|-aadriver| \
-sub@(-bg-@(alpha|color)|cp|delay|fps|pos|align|width)| \ -aaosdcolor|-aasubcolor|-vobsubout|-vobsuboutid|-vobsuboutindex| \
-sub@(font-@(blur|outline|autoscale|encoding|@(osd|text)-scale))) -sub-bg-alpha|-sub-bg-color|-sub-cp|-sub-delay|-sub-fps|-sub-pos| \
-sub-align|-sub-width|-subfont-blur|-subfont-outline| \
-subfont-autoscale|-subfont-encoding|-subfont-osd-scale| \
-subfont-osd-text)
return 0 return 0
;; ;;
-lavdopts) -lavdopts)

View File

@ -27,12 +27,12 @@ _msynctool()
esac esac
case $prev in case $prev in
--@(configure|@(add|del|show)group|sync|addmember)) --configure|--addgroup|--delgroup|--showgroup|--sync|--addmember)
COMPREPLY=( $( compgen -W '$(msynctool --listgroups \ COMPREPLY=( $( compgen -W '$(msynctool --listgroups \
| sed -e '1d' )' -- "$cur" ) ) | sed -e '1d' )' -- "$cur" ) )
return 0 return 0
;; ;;
--@(showformats|filter-objtype|slow-sync)) --showformats|--filter-objtype|--slow-sync)
COMPREPLY=( $( compgen -W '$(msynctool --listobjects \ COMPREPLY=( $( compgen -W '$(msynctool --listobjects \
| sed -e '1d' )' -- "$cur" ) ) | sed -e '1d' )' -- "$cur" ) )
return 0 return 0

View File

@ -10,11 +10,11 @@ _munin_run()
prev=`_get_pword` prev=`_get_pword`
case $prev in case $prev in
--@(config|sconffile)) --config|--sconffile)
_filedir _filedir
return 0 return 0
;; ;;
--@(service|sconf)dir) --servicedir|--sconfdir)
_filedir -d _filedir -d
return 0 return 0
;; ;;
@ -86,7 +86,7 @@ _munin_node_configure()
_filedir _filedir
return 0 return 0
;; ;;
--@(service|lib)dir) --servicedir|--libdir)
_filedir -d _filedir -d
return 0 return 0
;; ;;

View File

@ -149,7 +149,7 @@ _mutt()
;; ;;
*) *)
case "$prev" in case "$prev" in
-@(a|f|F|H|i)) -a|-f|-F|-H|-i)
_muttfiledir "$cur" _muttfiledir "$cur"
return 0 return 0
;; ;;
@ -157,7 +157,7 @@ _mutt()
_muttaliases "$cur" _muttaliases "$cur"
return 0 return 0
;; ;;
-@(e|m|Q|s|h|p|R|v|y|z|Z)) -e|-m|-Q|-s|-h|-p|-R|-v|-y|-z|-Z)
return 0 return 0
;; ;;
*) *)

View File

@ -47,7 +47,7 @@ _mii_diag()
_split_longopt && split=true _split_longopt && split=true
case $prev in case $prev in
-@(F|A|-advertise|-fixed-speed)) -F|-A|--advertise|--fixed-speed)
COMPREPLY=( $( compgen -W '100baseT4 100baseTx \ COMPREPLY=( $( compgen -W '100baseT4 100baseTx \
100baseTx-FD 100baseTx-HD 10baseT 10baseT-FD \ 100baseTx-FD 100baseTx-HD 10baseT 10baseT-FD \
10baseT-HD' -- "$cur" ) ) 10baseT-HD' -- "$cur" ) )

View File

@ -32,7 +32,7 @@ _ldapsearch()
_filedir -d _filedir -d
return 0 return 0
;; ;;
-@(f|y)) -f|-y)
_filedir _filedir
return 0 return 0
;; ;;
@ -76,7 +76,7 @@ _ldapaddmodify()
_ldap_uris _ldap_uris
return 0 return 0
;; ;;
-@(S|f|y)) -S|-f|-y)
_filedir _filedir
return 0 return 0
;; ;;
@ -114,7 +114,7 @@ _ldapdelete()
_ldap_uris _ldap_uris
return 0 return 0
;; ;;
-@(f|y)) -f|-y)
_filedir _filedir
return 0 return 0
;; ;;
@ -182,7 +182,7 @@ _ldapmodrdn()
_ldap_uris _ldap_uris
return 0 return 0
;; ;;
-@(f|y)) -f|-y)
_filedir _filedir
return 0 return 0
;; ;;
@ -216,7 +216,7 @@ _ldapwhoami()
_ldap_uris _ldap_uris
return 0 return 0
;; ;;
-@(f|y)) -f|-y)
_filedir _filedir
return 0 return 0
;; ;;
@ -250,7 +250,7 @@ _ldappasswd()
_ldap_uris _ldap_uris
return 0 return 0
;; ;;
-@(t|T|y)) -t|-T|-y)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -55,19 +55,23 @@ _openssl()
command=${COMP_WORDS[1]} command=${COMP_WORDS[1]}
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-@(CA|CAfile|CAkey|CAserial|cert|certfile|config|content|dcert|dkey|dhparam|extfile|in|inkey|kfile|key|keyout|out|oid|prvrify|rand|recip|revoke|sess_in|sess_out|spkac|sign|signkey|signer|signature|ss_cert|untrusted|verify)) -CA|-CAfile|-CAkey|-CAserial|-cert|-certfile|-config|-content| \
-dcert|-dkey|-dhparam|-extfile|-in|-inkey|-kfile|-key|-keyout| \
-out|-oid|-prvrify|-rand|-recip|-revoke|-sess_in|-sess_out| \
-spkac|-sign|-signkey|-signer|-signature|-ss_cert|-untrusted| \
-verify)
_filedir _filedir
return 0 return 0
;; ;;
-@(outdir|CApath)) -outdir|-CApath)
_filedir -d _filedir -d
return 0 return 0
;; ;;
-@(name|crlexts|extensions)) -name|-crlexts|-extensions)
_openssl_sections _openssl_sections
return 0 return 0
;; ;;
-@(in|out|key|cert|CA|CAkey|dkey|dcert)form) -inform|-outform|-keyform|-certform|-CAform|-CAkeyform|-dkeyform|-dcertform)
formats='DER PEM' formats='DER PEM'
case $command in case $command in
x509) x509)

View File

@ -12,7 +12,8 @@ _pkg_config()
_split_longopt && split=true _split_longopt && split=true
case $prev in case $prev in
--@(?(define-)variable|@(atleast?(-pkgconfig)|exact|max)-version)) --variable|--define-variable|--atleast-version|--atleast-pkgconfig-version| \
--exact-version|--max-version)
# argument required but no completions available # argument required but no completions available
return 0 return 0
;; ;;

View File

@ -10,11 +10,12 @@ _qemu()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-@(fd[ab]|hd[abcd]|cdrom|option-rom|kernel|initrd|bootp|pidfile|loadvm|mtdblock|sd|pflash|bios)) -fd[ab]|-hd[abcd]|-cdrom|-option-rom|-kernel|-initrd|-bootp|-pidfile| \
-loadvm|-mtdblock|-sd|-pflash|-bios)
_filedir _filedir
return 0 return 0
;; ;;
-@(tftp|smb|L|chroot)) -tftp|-smb|-L|-chroot)
_filedir -d _filedir -d
return 0 return 0
;; ;;
@ -53,7 +54,7 @@ _qemu()
-- "$cur" ) ) -- "$cur" ) )
return 0 return 0
;; ;;
-@(serial|parallel|monitor)) -serial|-parallel|-monitor)
COMPREPLY=( $( compgen -W 'vc pty none null /dev/ \ COMPREPLY=( $( compgen -W 'vc pty none null /dev/ \
file: stdio pipe: COM udp: tcp: telnet: unix: \ file: stdio pipe: COM udp: tcp: telnet: unix: \
mon: braille' -- "$cur" ) ) mon: braille' -- "$cur" ) )

View File

@ -115,7 +115,7 @@ _edquota()
_quota_formats _quota_formats
return 0 return 0
;; ;;
-@(f|-filesystem)) -f|--filesystem)
_filesystems _filesystems
return 0 return 0
;; ;;
@ -236,7 +236,7 @@ _quotaoff()
_quota_formats _quota_formats
return 0 return 0
;; ;;
-@(x|-xfs-command)) -x|--xfs-command)
COMPREPLY=( $( compgen -W 'delete enforce' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'delete enforce' -- "$cur" ) )
return 0 return 0
;; ;;

View File

@ -10,7 +10,7 @@ _resolvconf()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-@(a|d)) -a|-d)
_available_interfaces _available_interfaces
return 0 return 0
;; ;;

View File

@ -90,7 +90,7 @@ _rpm()
fi fi
case "$prev" in case "$prev" in
--@(@(db|exclude)path|prefix|relocate|root)) --dbpath|--excludepath|--prefix|--relocate|--root)
_filedir -d _filedir -d
return 0 return 0
;; ;;
@ -154,7 +154,7 @@ _rpm()
--quiet --pipe --verbose" --quiet --pipe --verbose"
case "${COMP_WORDS[1]}" in case "${COMP_WORDS[1]}" in
-@([iFU]*|-install|-freshen|-upgrade)) -[iFU]*|--install|--freshen|--upgrade)
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W "$opts --percent --force \ COMPREPLY=( $( compgen -W "$opts --percent --force \
--test --replacepkgs --replacefiles --root \ --test --replacepkgs --replacefiles --root \
@ -168,7 +168,7 @@ _rpm()
_filedir 'rpm' _filedir 'rpm'
fi fi
;; ;;
-@(e|-erase)) -e|--erase)
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W "$opts --allmatches \ COMPREPLY=( $( compgen -W "$opts --allmatches \
--noscripts --notriggers --nodeps --test --repackage" \ --noscripts --notriggers --nodeps --test --repackage" \
@ -177,7 +177,7 @@ _rpm()
_rpm_installed_packages "$nodig" "$nosig" _rpm_installed_packages "$nodig" "$nosig"
fi fi
;; ;;
-@(q*|-query)) -q*|--query)
# options common to all query types # options common to all query types
opts="$opts --changelog --configfiles --conflicts --docfiles opts="$opts --changelog --configfiles --conflicts --docfiles
--dump --enhances --filesbypkg --filecaps --fileclass --dump --enhances --filesbypkg --filecaps --fileclass
@ -215,7 +215,7 @@ _rpm()
fi fi
fi fi
;; ;;
-@(K*|-checksig)) -K*|--checksig)
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W "$opts --nopgp --nogpg --nomd5" \ COMPREPLY=( $( compgen -W "$opts --nopgp --nogpg --nomd5" \
-- "$cur" ) ) -- "$cur" ) )
@ -223,7 +223,7 @@ _rpm()
_filedir 'rpm' _filedir 'rpm'
fi fi
;; ;;
-@([Vy]*|-verify)) -[Vy]*|--verify)
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W "$opts --root --dbpath --nodeps \ COMPREPLY=( $( compgen -W "$opts --root --dbpath --nodeps \
--nogroup --nolinkto --nomode --nomtime --nordev --nouser \ --nogroup --nolinkto --nomode --nomtime --nordev --nouser \
@ -251,7 +251,7 @@ _rpm()
_filedir '@(t?(ar.)@([gx]z|bz?(2))|tar.@(lzma|Z))' _filedir '@(t?(ar.)@([gx]z|bz?(2))|tar.@(lzma|Z))'
fi fi
;; ;;
--re@(build|compile)) --rebuild|--recompile)
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W "$opts --nodeps --rmsource \ COMPREPLY=( $( compgen -W "$opts --nodeps --rmsource \
--rmspec --sign --nodirtokens --target" -- "$cur" ) ) --rmspec --sign --nodirtokens --target" -- "$cur" ) )
@ -262,13 +262,13 @@ _rpm()
--tarbuild) --tarbuild)
_filedir '@(t?(ar.)@([gx]z|bz?(2))|tar.@(lzma|Z))' _filedir '@(t?(ar.)@([gx]z|bz?(2))|tar.@(lzma|Z))'
;; ;;
--@(re|add)sign) --resign|--addsign)
_filedir 'rpm' _filedir 'rpm'
;; ;;
--set@(perms|gids)) --setperms|--setgids)
_rpm_installed_packages "$nodig" "$nosig" _rpm_installed_packages "$nodig" "$nosig"
;; ;;
--@(clean|rms@(ource|pec))) --clean|--rmsource|--rmspec)
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--clean --rmsource --rmspec' \ COMPREPLY=( $( compgen -W '--clean --rmsource --rmspec' \
-- "$cur" ) ) -- "$cur" ) )
@ -276,7 +276,7 @@ _rpm()
_filedir 'spec' _filedir 'spec'
fi fi
;; ;;
--@(import|dbpath|root)) --import|--dbpath|--root)
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--import --dbpath --root' \ COMPREPLY=( $( compgen -W '--import --dbpath --root' \
-- "$cur" ) ) -- "$cur" ) )

View File

@ -14,15 +14,15 @@ _rsync()
_expand || return 0 _expand || return 0
case "$prev" in case "$prev" in
--@(config|password-file|include-from|exclude-from)) --config|--password-file|--include-from|--exclude-from)
_filedir _filedir
return 0 return 0
;; ;;
-@(T|-temp-dir|-compare-dest)) -T|--temp-dir|--compare-dest)
_filedir -d _filedir -d
return 0 return 0
;; ;;
-@(e|-rsh)) -e|--rsh)
COMPREPLY=( $( compgen -W 'rsh ssh' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'rsh ssh' -- "$cur" ) )
return 0 return 0
;; ;;

View File

@ -105,7 +105,7 @@ _smbget()
_split_longopt && split=true _split_longopt && split=true
case $prev in case $prev in
-@(o|f|-outputfile|-rcfile)) -o|-f|--outputfile|--rcfile)
_filedir _filedir
return 0; return 0;
;; ;;
@ -239,7 +239,7 @@ _smbtar()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-@(r|t)) -r|-t)
_filedir tar _filedir tar
return 0; return 0;
;; ;;

View File

@ -35,7 +35,7 @@ _ssh()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(F|i|S)) -F|-i|-S)
_filedir _filedir
return 0 return 0
;; ;;
@ -117,7 +117,7 @@ _sftp()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(b|F|P)) -b|-F|-P)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -26,7 +26,7 @@ _svk()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-@(F|-file|-targets)) -F|--file|--targets)
_filedir _filedir
return 0; return 0;
;; ;;
@ -45,44 +45,44 @@ _svk()
add) add)
options=' --non-recursive -N -q --quiet' options=' --non-recursive -N -q --quiet'
;; ;;
@(blame|annotate|ann|praise)) blame|annotate|ann|praise)
options='-r --revisions -x --cross' options='-r --revisions -x --cross'
;; ;;
cat) cat)
options='-r --revision' options='-r --revision'
;; ;;
@(checkout|co)) checkout|co)
options='-r --revision -q --quiet -N --non-recursive -l \ options='-r --revision -q --quiet -N --non-recursive -l \
--list -d --detach --export --relocate --purge' --list -d --detach --export --relocate --purge'
;; ;;
cleanup) cleanup)
options='-a --all' options='-a --all'
;; ;;
@(cmerge|cm)) cmerge|cm)
options='-c --change -l --log -r --revision -a --auto \ options='-c --change -l --log -r --revision -a --auto \
--verbatim --no-ticket -m --message -F --file \ --verbatim --no-ticket -m --message -F --file \
--template --encoding -P --patch -S --sign -C \ --template --encoding -P --patch -S --sign -C \
--check-only --direct' --check-only --direct'
;; ;;
@(commit|ci)) commit|ci)
options='--import -m --message -F --file --encoding \ options='--import -m --message -F --file --encoding \
--template -P --patch -S --sign -C --check-only -N \ --template -P --patch -S --sign -C --check-only -N \
--non-recursive --direct' --non-recursive --direct'
;; ;;
@(copy|cp)) copy|cp)
options='-r --revision -p --parent -q --quiet -m --message \ options='-r --revision -p --parent -q --quiet -m --message \
-F --file --template --encoding -P --patch -S --sign \ -F --file --template --encoding -P --patch -S --sign \
-C --check-only --direct' -C --check-only --direct'
;; ;;
@(delete|del|remove|rm)) delete|del|remove|rm)
options='-k --keep-local -m --message -F --file --encoding \ options='-k --keep-local -m --message -F --file --encoding \
--template -P --patch -S --sign -C --check-only \ --template -P --patch -S --sign -C --check-only \
--direct' --direct'
;; ;;
@(depotmap|depot)) depotmap|depot)
options='-i --init -l --list -d --detach --relocate' options='-i --init -l --list -d --detach --relocate'
;; ;;
@(diff|di)) diff|di)
options='-r --revision -s --summarize -b --verbose -N \ options='-r --revision -s --summarize -b --verbose -N \
--non-recursive' --non-recursive'
;; ;;
@ -91,7 +91,7 @@ _svk()
-F --file --template --encoding -P --patch -S --sign \ -F --file --template --encoding -P --patch -S --sign \
-C --check-only -N --non-recursive --direct' -C --check-only -N --non-recursive --direct'
;; ;;
@(list|ls)) list|ls)
options='-r --revision -v --verbose -R --recursive -d \ options='-r --revision -v --verbose -R --recursive -d \
--depth -f --full-path' --depth -f --full-path'
;; ;;
@ -106,7 +106,7 @@ _svk()
-F --file --template --encoding -P --patch -S --sign \ -F --file --template --encoding -P --patch -S --sign \
-C --check-only --direct' -C --check-only --direct'
;; ;;
@(mirror|mi)) mirror|mi)
options='-l --list -d --detach --relocate --recover \ options='-l --list -d --detach --relocate --recover \
--unlock --upgrade' --unlock --upgrade'
;; ;;
@ -115,7 +115,7 @@ _svk()
--encoding -P --patch -S --sign -C --check-only \ --encoding -P --patch -S --sign -C --check-only \
--direct' --direct'
;; ;;
@(move|mv|rename|ren)) move|mv|rename|ren)
options='-r --revision -p --parent -q --quiet -m \ options='-r --revision -p --parent -q --quiet -m \
--message -F --file --encoding --template -P --patch \ --message -F --file --encoding --template -P --patch \
-S --sign -C --check-only --direct' -S --sign -C --check-only --direct'
@ -123,20 +123,20 @@ _svk()
patch) patch)
options='--depot' options='--depot'
;; ;;
@(propdel|propset|pdel|pset|pd|ps)) propdel|propset|pdel|pset|pd|ps)
options='-R --recursive -r --revision --revprop -m \ options='-R --recursive -r --revision --revprop -m \
--message -F --file --template --encoding -P --patch \ --message -F --file --template --encoding -P --patch \
-S --sign -C --check-only -q --quiet --direct' -S --sign -C --check-only -q --quiet --direct'
;; ;;
@(propedit|pedit|pe)) propedit|pedit|pe)
options='-R --recursive -r --revision --revprop -m \ options='-R --recursive -r --revision --revprop -m \
--message -F --file --template --encoding -P --patch \ --message -F --file --template --encoding -P --patch \
-S --sign -C --check-only --direct' -S --sign -C --check-only --direct'
;; ;;
@(propget|pget|pg)) propget|pget|pg)
options='-R --recursive -r --revision --revprop --strict' options='-R --recursive -r --revision --revprop --strict'
;; ;;
@(proplist|plist|pl)) proplist|plist|pl)
options='-R --recursive -v --verbose \ options='-R --recursive -v --verbose \
-r --revision --revprop' -r --revision --revprop'
;; ;;
@ -153,24 +153,24 @@ _svk()
revert) revert)
options='-R --recursive -q --quiet' options='-R --recursive -q --quiet'
;; ;;
@(smerge|sm)) smerge|sm)
options='-I --incremental -l --log -B --baseless -b \ options='-I --incremental -l --log -B --baseless -b \
--base -s --sync -t --to -f --from --verbatim \ --base -s --sync -t --to -f --from --verbatim \
--no-ticket --track-rename --host --remoterev -m \ --no-ticket --track-rename --host --remoterev -m \
--message -F --file --template --encoding -P --patch \ --message -F --file --template --encoding -P --patch \
-S --sign -C --check-only --direct' -S --sign -C --check-only --direct'
;; ;;
@(status|stat|st)) status|stat|st)
options='-q --quiet --no-ignore -N --non-recursive -v \ options='-q --quiet --no-ignore -N --non-recursive -v \
--verbose' --verbose'
;; ;;
@(switch|sw)) switch|sw)
options='-r --revision -d --detach -q --quiet' options='-r --revision -d --detach -q --quiet'
;; ;;
@(sync|sy)) sync|sy)
options='-a --all -s --skipto -t --torev' options='-a --all -s --skipto -t --torev'
;; ;;
@(update|up)) update|up)
options='-r --revision -N --non-recursive -C --check-only \ options='-r --revision -N --non-recursive -C --check-only \
-s --sync -m --merge -q --quiet' -s --sync -m --merge -q --quiet'
;; ;;
@ -180,7 +180,7 @@ _svk()
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
else else
case $command in case $command in
@(help|h|\?)) help|h|\?)
COMPREPLY=( $( compgen -W "$commands \ COMPREPLY=( $( compgen -W "$commands \
environment commands intro" -- "$cur" ) ) environment commands intro" -- "$cur" ) )
;; ;;
@ -198,7 +198,7 @@ _svk()
COMPREPLY=( $( compgen -W "$( svk mirror --list \ COMPREPLY=( $( compgen -W "$( svk mirror --list \
2>/dev/null | awk '/^\//{print $1}' )" -- "$cur" ) ) 2>/dev/null | awk '/^\//{print $1}' )" -- "$cur" ) )
;; ;;
@(co|checkout|push|pull)) co|checkout|push|pull)
if [[ "$cur" == //*/* ]]; then if [[ "$cur" == //*/* ]]; then
path=${cur%/*}/ path=${cur%/*}/
else else

View File

@ -10,7 +10,7 @@ _tcpdump()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-@(r|w|F)) -r|-w|-F)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -26,11 +26,11 @@ _update_alternatives()
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
--@(altdir|admindir)) --altdir|--admindir)
_filedir -d _filedir -d
return 0 return 0
;; ;;
--@(help|version)) --help|--version)
return 0 return 0
;; ;;
esac esac

View File

@ -18,7 +18,7 @@ _vpnc()
COMPREPLY=( $( compgen -W 'dh1 dh2 dh5' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'dh1 dh2 dh5' -- "$cur" ) )
return 0 return 0
;; ;;
--@(pid-file|script)) --pid-file|--script)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -14,7 +14,7 @@ _cdrecord()
prev=${cur/=*/} prev=${cur/=*/}
cur=${cur/*=/} cur=${cur/*=/}
case "$prev" in case "$prev" in
@(text|cue)file) textfile|cuefile)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -63,7 +63,7 @@ _xm()
sched-credit) sched-credit)
options='-d -w -c' options='-d -w -c'
;; ;;
@(block|network|vtpm|vnet)-list) block-list|network-list|vtpm-list|vnet-list)
options='-l --long' options='-l --long'
;; ;;
getpolicy) getpolicy)
@ -81,7 +81,9 @@ _xm()
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
else else
case $command in case $command in
@(console|destroy|domname|domid|list|mem-@(set|max)|pause|reboot|rename|shutdown|unpause|vcpu-@(list|pin|set)|block-list|network-list|vtpm-list)) console|destroy|domname|domid|list|mem-set|mem-max| \
pause|reboot|rename|shutdown|unpause|vcpu-list|vcpu-pin| \
vcpu-set|block-list|network-list|vtpm-list)
_count_args _count_args
case $args in case $args in
2) 2)
@ -100,7 +102,7 @@ _xm()
;; ;;
esac esac
;; ;;
@(restore|dry-run|vnet-create)) restore|dry-run|vnet-create)
_filedir _filedir
;; ;;
save) save)
@ -196,7 +198,7 @@ _xm()
;; ;;
new) new)
case $prev in case $prev in
-@(f|F|-defconfig|-config)) -f|-F|--defconfig|--config)
_filedir _filedir
return 0 return 0
;; ;;

View File

@ -23,7 +23,7 @@ _xz()
local xspec="*.@(xz|lzma)" local xspec="*.@(xz|lzma)"
case "$prev" in case "$prev" in
-@(!(-*)[dlt]*|-decompress|-list|-test)) --decompress|--list|--test|!(-*)[dlt]*)
xspec="!"$xspec xspec="!"$xspec
;; ;;
--files|--files0) --files|--files0)