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
* contrib/cpio: added missing completions for -?, --help, --license, --usage,
--version and (-p) --to-stdout (Debian: #557436)
* Style policy: don't use fancy globbing in case labels
[ Ville Skyttä ]
* Create bz2 dist tarball too.

View File

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

View File

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

View File

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

View File

@ -40,11 +40,13 @@ _aptitude()
if [[ -n "$special" ]]; then
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 ) )
return 0
;;
@(purge|remove|reinstall|forbid-version))
purge|remove|reinstall|forbid-version)
COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
return 0
;;
@ -57,14 +59,14 @@ _aptitude()
case $prev in
# 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
;;
-S)
_filedir
return 0
;;
-@(t|-@(target|default)-release))
-t|--target-release|--default-release)
COMPREPLY=( $( apt-cache policy | \
grep "release.o=Debian,a=$cur" | \
sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null ) )

View File

@ -25,11 +25,11 @@ _aspell()
_split_longopt && split=true
case "$prev" in
-c|-p|check|--@(conf|personal|repl|per-conf))
-c|-p|check|--conf|--personal|--repl|--per-conf)
_filedir
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
return 0
;;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -40,23 +40,25 @@ _dpkg()
fi
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'
return 0
;;
-@(b|-build))
-b|--build)
_filedir -d
return 0
;;
-@(s|p|l|-@(status|print-avail|list)))
-s|-p|-l|--status|--print-avail|--list)
COMPREPLY=( $( apt-cache pkgnames "$cur" 2>/dev/null ) )
return 0
;;
-@(S|-search))
-S|--search)
_filedir
return 0
;;
-@(r|L|P|-@(remove|purge|listfiles)))
-r|-L|-P|--remove|--purge|--listfiles)
COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
return 0
;;
@ -107,14 +109,14 @@ _dpkg_reconfigure()
case "$prev" in
-@(f|-frontend))
-f|--frontend)
opt=( $( echo /usr/share/perl5/Debconf/FrontEnd/* ) )
opt=( ${opt[@]##*/} )
opt=( ${opt[@]%.pm} )
COMPREPLY=( $( compgen -W '${opt[@]}' -- "$cur" ) )
return 0
;;
-@(p|-priority))
-p|--priority)
COMPREPLY=( $( compgen -W 'low medium high critical' -- "$cur" ) )
return 0
;;

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,8 @@ _mkisofs()
prev=${COMP_WORDS[COMP_CWORD-1]}
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
return 0
;;

View File

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

View File

@ -14,18 +14,18 @@ _gpg2 ()
_filedir -d
return 0
;;
-@(s|-sign|-clearsign|-options|-decrypt))
-s|--sign|--clearsign|--options|--decrypt)
_filedir
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
COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \
sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \
-ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) )
return 0
;;
-@(r|-recipient))
-r|--recipient)
COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \
sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ))
if [ -e ~/.gnupg/gpg.conf ]; then

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,7 +12,7 @@ _make()
_split_longopt && split=true
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
return 0
;;

View File

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

View File

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

View File

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

View File

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

View File

@ -25,7 +25,7 @@ _mock()
_split_longopt && split=true
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
;;
-r|--root)
@ -33,7 +33,7 @@ _mock()
COMPREPLY=( ${COMPREPLY[@]/%.cfg/} )
return 0
;;
--@(config|result)dir)
--configdir|--resultdir)
_filedir -d
return 0
;;
@ -51,7 +51,7 @@ _mock()
-- "$cur" ) )
return 0
;;
--@(en|dis)able-plugin)
--enable-plugin|--disable-plugin)
COMPREPLY=( $( compgen -W "$plugins" -- "$cur" ) )
return 0
;;

View File

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

View File

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

View File

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

View File

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

View File

@ -149,7 +149,7 @@ _mutt()
;;
*)
case "$prev" in
-@(a|f|F|H|i))
-a|-f|-F|-H|-i)
_muttfiledir "$cur"
return 0
;;
@ -157,7 +157,7 @@ _mutt()
_muttaliases "$cur"
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
;;
*)

View File

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

View File

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

View File

@ -55,19 +55,23 @@ _openssl()
command=${COMP_WORDS[1]}
prev=${COMP_WORDS[COMP_CWORD-1]}
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
return 0
;;
-@(outdir|CApath))
-outdir|-CApath)
_filedir -d
return 0
;;
-@(name|crlexts|extensions))
-name|-crlexts|-extensions)
_openssl_sections
return 0
;;
-@(in|out|key|cert|CA|CAkey|dkey|dcert)form)
-inform|-outform|-keyform|-certform|-CAform|-CAkeyform|-dkeyform|-dcertform)
formats='DER PEM'
case $command in
x509)

View File

@ -12,7 +12,8 @@ _pkg_config()
_split_longopt && split=true
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
return 0
;;

View File

@ -10,11 +10,12 @@ _qemu()
prev=${COMP_WORDS[COMP_CWORD-1]}
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
return 0
;;
-@(tftp|smb|L|chroot))
-tftp|-smb|-L|-chroot)
_filedir -d
return 0
;;
@ -53,7 +54,7 @@ _qemu()
-- "$cur" ) )
return 0
;;
-@(serial|parallel|monitor))
-serial|-parallel|-monitor)
COMPREPLY=( $( compgen -W 'vc pty none null /dev/ \
file: stdio pipe: COM udp: tcp: telnet: unix: \
mon: braille' -- "$cur" ) )

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -63,7 +63,7 @@ _xm()
sched-credit)
options='-d -w -c'
;;
@(block|network|vtpm|vnet)-list)
block-list|network-list|vtpm-list|vnet-list)
options='-l --long'
;;
getpolicy)
@ -81,7 +81,9 @@ _xm()
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
else
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
case $args in
2)
@ -100,7 +102,7 @@ _xm()
;;
esac
;;
@(restore|dry-run|vnet-create))
restore|dry-run|vnet-create)
_filedir
;;
save)
@ -196,7 +198,7 @@ _xm()
;;
new)
case $prev in
-@(f|F|-defconfig|-config))
-f|-F|--defconfig|--config)
_filedir
return 0
;;

View File

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