no need to quote case argument nor targets

This commit is contained in:
Guillaume Rousse 2009-12-30 00:39:59 +01:00
parent 877d36fefb
commit f2041ce0e4
72 changed files with 181 additions and 181 deletions

View File

@ -61,7 +61,7 @@ _module ()
COMPREPLY=( $(compgen -W "$options" -- "$cur") )
elif [ $COMP_CWORD -eq 2 ] ; then
case "$prev" in
case $prev in
add|display|help|load|show|whatis)
COMPREPLY=( $(_module_avail "$cur") )
;;

View File

@ -18,14 +18,14 @@ _abook()
return 0
}
case "$cur" in
case $cur in
-*)
_longopt abook
return 0
;;
esac
case "$prev" in
case $prev in
--informat)
[ ${BASH_VERSINFO[0]} -ge 4 ] && compopt +o filenames
COMPREPLY=( $( compgen -W "$(abook --formats | \

View File

@ -10,7 +10,7 @@ _ant()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-buildfile|-file|-f)
_filedir 'xml'
return 0

View File

@ -35,7 +35,7 @@ _apt_get()
esac
fi
case "$prev" in
case $prev in
-c|--config-file)
_filedir
return 0
@ -111,7 +111,7 @@ _apt_cache()
fi
case "$prev" in
case $prev in
-c|-p|-s|--config-file|--pkg-cache|--src-cache)
_filedir
return 0

View File

@ -31,7 +31,7 @@ _apt_build()
esac
fi
case "$prev" in
case $prev in
--patch|--build-dir|--repository-dir)
_filedir
return 0

View File

@ -24,7 +24,7 @@ _aspell()
_split_longopt && split=true
case "$prev" in
case $prev in
-c|-p|check|--conf|--personal|--repl|--per-conf)
_filedir
return 0

View File

@ -7,7 +7,7 @@ _alias()
COMPREPLY=()
cur=`_get_cword`
case "$COMP_LINE" in
case $COMP_LINE in
*[^=])
COMPREPLY=( $( compgen -A alias -- "$cur" ) )
;;
@ -28,7 +28,7 @@ _export()
COMPREPLY=()
cur=`_get_cword`
case "$COMP_LINE" in
case $COMP_LINE in
*=\$*)
COMPREPLY=( $( compgen -v -P '$' -- "${cur#*=\$}" ) )
;;

View File

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

View File

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

View File

@ -8,7 +8,7 @@ _chsh()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
--list-shells|--help|-v|--version)
return 0
;;

View File

@ -11,7 +11,7 @@ _cksfv()
return 0
fi
case "${COMP_WORDS[$COMP_CWORD-1]}" in
case ${COMP_WORDS[$COMP_CWORD-1]} in
-C)
_filedir -d
return 0

2
contrib/configure vendored
View File

@ -10,7 +10,7 @@ _configure()
_split_longopt && split=true
case "$prev" in
case $prev in
--prefix|--exec-prefix|--*dir)
_filedir -d
;;

View File

@ -141,9 +141,9 @@ _cvs()
count=$((++count))
done
case "$mode" in
case $mode in
add)
case "$prev" in
case $prev in
-m)
return 0
;;
@ -171,7 +171,7 @@ _cvs()
fi
;;
admin)
case "$prev" in
case $prev in
-a|-A|-b|-c|-e|-l|-m|-n|-N|-o|-s|-t-|-u)
return 0
;;
@ -202,7 +202,7 @@ _cvs()
fi
;;
checkout)
case "$prev" in
case $prev in
-r|-D|j)
return 0
;;
@ -227,7 +227,7 @@ _cvs()
fi
;;
commit)
case "$prev" in
case $prev in
-m|-r)
return 0
;;
@ -268,7 +268,7 @@ _cvs()
_cvs_roots
;;
export)
case "$prev" in
case $prev in
-r|-D)
return 0
;;
@ -316,7 +316,7 @@ _cvs()
fi
;;
import)
case "$prev" in
case $prev in
-I|-b|-m|-W)
return 0
;;
@ -344,7 +344,7 @@ _cvs()
fi
;;
update)
case "$prev" in
case $prev in
-r|-D|-j|-I|-W)
return 0
;;
@ -360,7 +360,7 @@ _cvs()
fi
;;
"")
case "$prev" in
case $prev in
-T)
_filedir -d
return 0

View File

@ -6,7 +6,7 @@ _cvsps()
COMPREPLY=()
local cur=`_get_cword :` prev=`_get_pword :`
case "$prev" in
case $prev in
-h|-z|-f|-d|-l|--diff-opts|--debuglvl)
return 0
;;

View File

@ -8,7 +8,7 @@ _dd()
COMPREPLY=()
cur=`_get_cword =`
case "$cur" in
case $cur in
if=*|of=*)
cur=${cur#*=}
_filedir

View File

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

View File

@ -17,7 +17,7 @@ _dict()
dictfile=/usr/share/dict/words
for (( i=1; i < COMP_CWORD; i++ )); do
case "${COMP_WORDS[i]}" in
case ${COMP_WORDS[i]} in
-h|--host)
host=${COMP_WORDS[i+1]}
[ -n "$host" ] && host="-h $host"
@ -50,7 +50,7 @@ _dict()
return 0
fi
case "$prev" in
case $prev in
-d|--database|-i|-info)
COMPREPLY=( $( compgen -W '$( _dictdata -D )' -- "$cur" ) )
return 0

View File

@ -39,7 +39,7 @@ _dpkg()
done
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)
@ -108,7 +108,7 @@ _dpkg_reconfigure()
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-f|--frontend)
opt=( $( printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/* ) )
opt=( ${opt[@]##*/} )
@ -165,14 +165,14 @@ _dpkg_source()
return 0
fi
done
case "$action" in
"unpack")
case $action in
unpack)
if [[ "$cur" == - || "$cur" == -s ]]; then
COMPREPLY=( $unpackopts )
return 0
fi
case "$prev" in
"-x")
case $prev in
-x)
COMPREPLY=( $( compgen -d -- "$cur" ) \
$( compgen -f -X '!*.dsc' -- "$cur" ) )
return 0
@ -184,7 +184,7 @@ _dpkg_source()
esac
return 0
;;
"pack")
pack)
if [ "$cur" = "-" ]; then
COMPREPLY=( $packopts )
return 0
@ -194,12 +194,12 @@ _dpkg_source()
"-sA" "-sK" "-sP" "-sU" "-sR" )
return 0
fi
case "$prev" in
"-b")
case $prev in
-b)
COMPREPLY=( $( compgen -d -- "$cur" ) )
return 0
;;
"-c"|"-l"|"-T"|"-i"|"-I")
-c|-l|-T|-i|-I)
# -c: get controlfile
# -l: get per-version info from this file
# -T: read variables here, not debian/substvars
@ -209,19 +209,19 @@ _dpkg_source()
COMPREPLY=( $( compgen -d -f ) )
return 0
;;
"-F")
-F)
# -F: force change log format
COMPREPLY=( $( ( cd /usr/lib/dpkg/parsechangelog; compgen -f "$cur" ) ) )
return 0
;;
"-V"|"-D")
-V|-D)
# -V: set a substitution variable
# we don't know anything about possible variables or values
# so we don't try to suggest any completion.
COMPREPLY=()
return 0
;;
"-D")
-D)
# -D: override or add a .dsc field and value
# if $cur doesn't contain a = yet, suggest variable names
if [[ "$cur" == *=* ]]; then
@ -233,7 +233,7 @@ _dpkg_source()
return 0
fi
;;
"-U")
-U)
# -U: remove a field
# Suggest possible fieldnames
COMPREPLY=( Format Source Version Binary Maintainer Uploader Architecture Standards-Version Build-Depends Files )

View File

@ -9,7 +9,7 @@ _dselect()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
--admindir)
_filedir -d
return 0

View File

@ -9,7 +9,7 @@ _arpspoof()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-i)
_interfaces
return 0
@ -38,7 +38,7 @@ _dnsspoof()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-i)
_interfaces
return 0
@ -65,7 +65,7 @@ _dsniff()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-r|-w|-f)
_filedir
return 0
@ -92,7 +92,7 @@ _snarf()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-i)
_interfaces
return 0
@ -115,7 +115,7 @@ _macof()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-i)
_interfaces
return 0
@ -156,7 +156,7 @@ _sshow()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-i)
_interfaces
return 0
@ -179,7 +179,7 @@ _tcpkill()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-i)
_interfaces
return 0
@ -202,7 +202,7 @@ _tcpnice()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-i)
_interfaces
return 0
@ -225,7 +225,7 @@ _urlsnarf()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-i)
_interfaces
return 0

View File

@ -11,7 +11,7 @@ _find()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-maxdepth|-mindepth)
COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) )
return 0

View File

@ -9,7 +9,7 @@ _civserver()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-f|-g|-l|-r|--file|--log|--gamelog|--read)
_filedir
return 0
@ -34,7 +34,7 @@ _civclient()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-l|-S|-t|--log|--Sound|--tiles)
_filedir
return 0

View File

@ -6,7 +6,7 @@ _fusermount()
COMPREPLY=()
local cur=`_get_cword` prev=`_get_pword`
case "$prev" in
case $prev in
-h|-V|-o)
return 0
;;

View File

@ -18,7 +18,7 @@ _gcc()
_expand || return 0
case "$1" in
case $1 in
gcj)
backend=jc1
;;

View File

@ -9,7 +9,7 @@ _mkisofs()
cur=`_get_cword`
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)
_filedir

View File

@ -9,7 +9,7 @@ _gkrellm()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-t|--theme)
_filedir -d
return 0

View File

@ -9,7 +9,7 @@ _gpg()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-s|--sign|--clearsign|--decrypt-files|--load-extension)
_filedir
return 0

View File

@ -9,7 +9,7 @@ _gpg2 ()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
--homedir)
_filedir -d
return 0

View File

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

View File

@ -6,7 +6,7 @@ _ImageMagick()
local prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-channel)
COMPREPLY=( $( compgen -W 'Red Green Blue Opacity \
Matte Cyan Magenta Yellow Black' -- "$cur" ) )

View File

@ -9,7 +9,7 @@ _ipmitool()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-I)
COMPREPLY=( $( compgen -W 'open imb lan lanplus free' -- "$cur" ) )
return 0

View File

@ -20,7 +20,7 @@ _iptables()
_split_longopt
case "$prev" in
case $prev in
-*[AIDRPFXLZ])
COMPREPLY=( $( compgen -W '`iptables $table -nL | \
sed -ne "s/^Chain \([^ ]\{1,\}\).*$/\1/p"`' -- "$cur" ) )

View File

@ -13,7 +13,7 @@ _jar()
return 0
fi
case "${COMP_WORDS[1]}" in
case ${COMP_WORDS[1]} in
*c*f)
_filedir
;;

View File

@ -256,7 +256,7 @@ _pack200()
COMPREPLY=()
local cur=`_get_cword` prev=`_get_pword`
case "$prev" in
case $prev in
-S|--segment-limit|-P|--pass-file|-C|--class-attribute|\
-F|--field-attribute|-M|--method-attribute|-D|--code-attribute|\
'-?'|-h|--help|-V|--version|-J)
@ -292,7 +292,7 @@ _pack200()
# Check if a pack or a jar was already given.
local i pack=false jar=false
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do
case "${COMP_WORDS[i]}" in
case ${COMP_WORDS[i]} in
*.pack|*.pack.gz) pack=true ;;
*.jar) jar=true ;;
esac
@ -323,7 +323,7 @@ _unpack200()
COMPREPLY=()
local cur=`_get_cword` prev=`_get_pword`
case "$prev" in
case $prev in
'-?'|-h|--help|-V|--version|-J)
return 0
;;
@ -341,7 +341,7 @@ _unpack200()
# Check if a pack or a jar was already given.
local i pack=false jar=false
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do
case "${COMP_WORDS[i]}" in
case ${COMP_WORDS[i]} in
*.pack|*.pack.gz) pack=true ;;
*.jar) jar=true ;;
esac
@ -368,7 +368,7 @@ _jarsigner()
COMPREPLY=()
local cur=`_get_cword` prev=`_get_pword`
case "$prev" in
case $prev in
-keystore)
COMPREPLY=( $( compgen -W 'NONE' -- "$cur" ) )
_filedir '@(jks|ks|p12|pfx)'

View File

@ -6,7 +6,7 @@ _k3b()
local cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]}
COMPREPLY=()
case "$prev" in
case $prev in
--help*|--author|-v|--version|--license|--lang)
return 0
;;

View File

@ -9,7 +9,7 @@ _ldapvi()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-h|--host)
_known_hosts_real "$cur"
return 0

View File

@ -9,7 +9,7 @@ _lftp()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-f)
_filedir
return 0

View File

@ -8,7 +8,7 @@ _links()
COMPREPLY=()
cur=`_get_cword`
case "$cur" in
case $cur in
--*)
COMPREPLY=( $( compgen -W '--help' -- "$cur" ) )
;;

View File

@ -81,7 +81,7 @@ _pvs()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-o|-O|--options|--sort)
COMPREPLY=( $( compgen -W 'pv_fmt pv_uuid \
pv_size pv_free pv_used pv_name \
@ -114,7 +114,7 @@ _pvdisplay()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
--units)
_units
return 0
@ -138,7 +138,7 @@ _pvchange()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|-x|--autobackup|--allocatable)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -164,7 +164,7 @@ _pvcreate()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
--restorefile)
_filedir
return 0
@ -203,7 +203,7 @@ _pvmove()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -262,7 +262,7 @@ _vgs()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-o|-O|--options|--sort)
COMPREPLY=( $( compgen -W 'vg_fmt vg_uuid vg_name \
vg_attr vg_size vg_free vg_sysid \
@ -297,7 +297,7 @@ _vgdisplay()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
--units)
_units
return 0
@ -322,7 +322,7 @@ _vgchange()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-a|-A|-x|--available|--autobackup|--resizeable)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -349,7 +349,7 @@ _vgcreate()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -404,7 +404,7 @@ _vgrename()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -428,7 +428,7 @@ _vgreduce()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -459,7 +459,7 @@ _vgextend()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -524,7 +524,7 @@ _vgconvert()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-M|--metadatatype)
COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) )
return 0
@ -557,7 +557,7 @@ _vgcfgbackup()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-f|--file)
_filedir
return 0
@ -582,7 +582,7 @@ _vgcfgrestore()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-f|--file)
_filedir
return 0
@ -615,7 +615,7 @@ _vgmerge()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -639,7 +639,7 @@ _vgsplit()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -704,7 +704,7 @@ _lvs()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-o|-O|--options|--sort)
COMPREPLY=( $( compgen -W 'lv_uuid lv_name lv_attr lv_minor \
lv_size seg_count origin snap_percent segtype stripes \
@ -736,7 +736,7 @@ _lvdisplay()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
--units)
_units
return 0
@ -760,7 +760,7 @@ _lvchange()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-a|-A|-C|-M|--available|--autobackup|--continguous|--persistent)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -792,7 +792,7 @@ _lvcreate()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|-C|-M|-Z|--autobackup|--continguous|--persistent|--zero)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -837,7 +837,7 @@ _lvremove()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -861,7 +861,7 @@ _lvrename()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -885,7 +885,7 @@ _lvreduce()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -914,7 +914,7 @@ _lvresize()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0
@ -949,7 +949,7 @@ _lvextend()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-A|--autobackup)
COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
return 0

View File

@ -20,7 +20,7 @@ _lzop()
return 0
fi
case "$prev" in
case $prev in
-o|--output)
_filedir
return 0
@ -35,7 +35,7 @@ _lzop()
esac
xspec="*.?(t)lzo"
case "$prev" in
case $prev in
--decompress|--uncompress|--extract|--list|--ls|--info|--test)
xspec="!"$xspec
;;

View File

@ -33,7 +33,7 @@ _add_members()
_split_longopt && split=true
case "$prev" in
case $prev in
-r|-d|--regular-members-file|--digest-members-file)
_filedir
return 0
@ -68,7 +68,7 @@ _remove_members()
_split_longopt && split=true
case "$prev" in
case $prev in
-f|--file)
_filedir
return 0
@ -98,7 +98,7 @@ _find_member()
_split_longopt && split=true
case "$prev" in
case $prev in
-l|-x|--listname|--exclude)
_mailman_lists
return 0
@ -126,7 +126,7 @@ _clone_member()
_split_longopt && split=true
case "$prev" in
case $prev in
-l|--listname)
_mailman_lists
return 0
@ -154,7 +154,7 @@ _sync_members()
_split_longopt && split=true
case "$prev" in
case $prev in
-w|-g|-d|--welcome-msg|--goodbye-msg|--digest)
COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
return 0
@ -240,7 +240,7 @@ _list_members()
_split_longopt && split=true
case "$prev" in
case $prev in
-o|--output)
_filedir
return 0
@ -279,7 +279,7 @@ _change_pw()
_split_longopt && split=true
case "$prev" in
case $prev in
-l|--listname)
_mailman_lists
return 0
@ -359,7 +359,7 @@ _config_list()
_split_longopt && split=true
case "$prev" in
case $prev in
-i|-o|--inputfile|--outputfile)
_filedir
return 0
@ -391,7 +391,7 @@ _arch()
_split_longopt && split=true
case "$prev" in
case $prev in
-w|-g|-d|--welcome-msg|--goodbye-msg|--digest)
COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
return 0
@ -454,7 +454,7 @@ _inject()
_split_longopt && split=true
case "$prev" in
case $prev in
-l|--listname)
_mailman_lists
return 0

View File

@ -11,7 +11,7 @@ _mc()
_split_longopt && split=true
case "$prev" in
case $prev in
-e|--edit|-v|--view|-l|--ftplog|-P|--printwd)
_filedir
return 0

View File

@ -9,7 +9,7 @@ _mcrypt()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-g|--openpgp-z)
COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) )
return 0

View File

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

View File

@ -39,7 +39,7 @@ _mdtool()
-S":" -- "$cur" ) )
# TODO: This does not work :(
#if [[ "$prev" == *: ]]; then
# case "$prev" in
# case $prev in
# @(--p:|--project:))
# COMPREPLY=( $( compgen -f -G "*.mdp" -- "$cur" ) )
# ;;

View File

@ -18,7 +18,7 @@ _mplayer()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-[av][cfo]|-[av]fm|-vop|-fstype|-demuxer|-o[av]c|-of|-profile)
_mplayer_options_list $cmd $prev
return 0
@ -229,7 +229,7 @@ _mplayer()
;;
esac
case "$cur" in
case $cur in
-*)
COMPREPLY=( $( compgen -W '$( $cmd -list-options 2>/dev/null | \
sed -ne '1,/^[[:space:]]*Name/d' \

View File

@ -142,14 +142,14 @@ _mutt()
COMPREPLY=()
case "$cur" in
case $cur in
-*)
COMPREPLY=( $( compgen -W '-A -a -b -c -e -f -F -H -i -m -n \
-p -Q -R -s -v -x -y -z -Z -h' -- "$cur" ) )
return 0
;;
*)
case "$prev" in
case $prev in
-a|-f|-F|-H|-i)
_muttfiledir "$cur"
return 0

View File

@ -11,7 +11,7 @@ _mysqladmin()
_split_longopt && split=true
case "$prev" in
case $prev in
-u|--user)
COMPREPLY=( $( compgen -u -- "$cur" ) )
return 0

View File

@ -19,7 +19,7 @@ _ldapsearch()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-h)
_known_hosts_real "$cur"
return 0
@ -67,7 +67,7 @@ _ldapaddmodify()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-h)
_known_hosts_real "$cur"
return 0
@ -105,7 +105,7 @@ _ldapdelete()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-h)
_known_hosts_real "$cur"
return 0
@ -139,7 +139,7 @@ _ldapcompare()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-h)
_known_hosts_real "$cur"
return 0
@ -173,7 +173,7 @@ _ldapmodrdn()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-h)
_known_hosts_real "$cur"
return 0
@ -207,7 +207,7 @@ _ldapwhoami()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-h)
_known_hosts_real "$cur"
return 0
@ -241,7 +241,7 @@ _ldappasswd()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-h)
_known_hosts_real "$cur"
return 0

View File

@ -18,7 +18,7 @@ _p4()
if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W "$p4commands" -- "$cur" ) )
elif [ $COMP_CWORD -eq 2 ]; then
case "$prev" in
case $prev in
help)
COMPREPLY=( $( compgen -W "simple commands \
environment filetypes jobview revisions \
@ -32,9 +32,9 @@ _p4()
esac
elif [ $COMP_CWORD -gt 2 ]; then
prev2=${COMP_WORDS[COMP_CWORD-2]}
case "$prev" in
case $prev in
-t)
case "$prev2" in
case $prev2 in
add|edit|reopen)
COMPREPLY=( $( compgen -W "$p4filetypes" -- "$cur") )
;;

View File

@ -29,7 +29,7 @@ _perl()
fi
# only handle module completion for now
case "$prev" in
case $prev in
-I|-x)
local IFS=$'\t\n'
COMPREPLY=( $( compgen -d $optPrefix $optSuffix -- "$cur" ) )

View File

@ -30,7 +30,7 @@ _createdb()
_split_longopt && split=true
case "$prev" in
case $prev in
-h|--host)
_known_hosts_real "$cur"
return 0
@ -73,7 +73,7 @@ _dropdb()
_split_longopt && split=true
case "$prev" in
case $prev in
-h|--host)
_known_hosts_real "$cur"
return 0
@ -111,7 +111,7 @@ _psql()
_split_longopt && split=true
case "$prev" in
case $prev in
-h|--host)
_known_hosts_real "$cur"
return 0

View File

@ -9,7 +9,7 @@ _python()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]##*/}
case "$prev" in
case $prev in
-Q)
COMPREPLY=( $( compgen -W "old new warn warnall" -- "$cur" ) )
return 0

View File

@ -9,7 +9,7 @@ _reportbug()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-f|--filename|-i|--include|--mta|-o|--output)
_filedir
return 0
@ -91,7 +91,7 @@ _querybts()
_split_longopt && split=true
case "$prev" in
case $prev in
-B|--bts)
COMPREPLY=( $( compgen -W "debian guug kde mandrake help" \
-- "$cur" ))

View File

@ -63,7 +63,7 @@ _rpm()
if [ $COMP_CWORD -eq 1 ]; then
# first parameter on line
case "$cur" in
case $cur in
-b*)
COMPREPLY=( $( compgen -W '-ba -bb -bc -bi -bl -bp -bs' \
-- "$cur" ) )
@ -89,7 +89,7 @@ _rpm()
return 0
fi
case "$prev" in
case $prev in
--dbpath|--excludepath|--prefix|--relocate|--root)
_filedir -d
return 0
@ -153,7 +153,7 @@ _rpm()
opts="--define --eval --macros --nodigest --nosignature --rcfile \
--quiet --pipe --verbose"
case "${COMP_WORDS[1]}" in
case ${COMP_WORDS[1]} in
-[iFU]*|--install|--freshen|--upgrade)
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W "$opts --percent --force \

View File

@ -11,7 +11,7 @@ _rsync()
_expand || return 0
case "$prev" in
case $prev in
--config|--password-file|--include-from|--exclude-from)
_filedir
return 0
@ -30,7 +30,7 @@ _rsync()
;;
esac
case "$cur" in
case $cur in
-*)
COMPREPLY=( $( compgen -W '--verbose --quiet --checksum --no-motd \
--checksum --archive --recursive --relative --no-implied-dirs \

View File

@ -24,14 +24,14 @@ _screen()
[ "$COMP_CWORD" -ge 2 ] && preprev=${COMP_WORDS[COMP_CWORD-2]}
case "$preprev" in
case $preprev in
-[dD])
_screen_sessions
return 0
;;
esac
case "$prev" in
case $prev in
-[rR])
# list detached
_screen_sessions 'Detached'

View File

@ -14,7 +14,7 @@ _useradd()
# TODO: if -o/--non-unique is given, could complete on existing uids
# with -u/--uid
case "$prev" in
case $prev in
-c|--comment|-h|--help|-e|--expiredate|-f|--inactive|-k|--key|-p|--password|-u|--uid|-Z|--selinux-user)
return 0
;;
@ -65,7 +65,7 @@ _usermod()
# TODO: if -o/--non-unique is given, could complete on existing uids
# with -u/--uid
case "$prev" in
case $prev in
-c|--comment|-d|--home|-e|--expiredate|-f|--inactive|-h|--help|-l|--login|-p|--password|-u|--uid|-Z|--selinux-user)
return 0
;;
@ -128,7 +128,7 @@ _chage()
_split_longopt && split=true
case "$prev" in
case $prev in
-d|--lastday|-E|--expiredate|-h|--help|-I|--inactive|-m|--mindays|-M|--maxdays|-W|--warndays)
return 0
;;
@ -155,7 +155,7 @@ _passwd()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-n|-x|-w|-i|-\?|--help|--usage)
return 0
;;
@ -182,7 +182,7 @@ _chpasswd()
_split_longopt && split=true
case "$prev" in
case $prev in
-c|--crypt)
COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \
-- "$cur" ) )
@ -214,7 +214,7 @@ _newusers()
_split_longopt && split=true
case "$prev" in
case $prev in
-c|--crypt)
COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \
-- "$cur" ) )
@ -268,7 +268,7 @@ _groupadd()
# TODO: if -o/--non-unique is given, could complete on existing gids
# with -g/--gid
case "$prev" in
case $prev in
-g|--gid|-K|--key|-p|--password)
return 0
;;
@ -298,7 +298,7 @@ _groupmod()
# TODO: if -o/--non-unique is given, could complete on existing gids
# with -g/--gid
case "$prev" in
case $prev in
-g|--gid|-h|--help|-n|--new-name|-p|--password)
return 0
;;
@ -337,7 +337,7 @@ _gpasswd()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-a|-d|-A|-M)
COMPREPLY=( $( compgen -u -- "$cur" ) )
return 0
@ -362,7 +362,7 @@ _groupmems()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-a|-d)
COMPREPLY=( $( compgen -u -- "$cur" ) )
return 0
@ -406,7 +406,7 @@ _vipw()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-h|--help)
return 0
;;
@ -431,7 +431,7 @@ _faillog()
_split_longopt && split=true
case "$prev" in
case $prev in
-h|--help|-l|--lock-time|-m|--maximum|-t|--time)
return 0
;;
@ -462,7 +462,7 @@ _lastlog()
_split_longopt && split=true
case "$prev" in
case $prev in
-b|--before|-h|--help|-t|--time)
return 0
;;

View File

@ -10,7 +10,7 @@ _sitecopy()
COMPREPLY=()
cur=`_get_cword`
case "$cur" in
case $cur in
--*)
COMPREPLY=( $( compgen -W "$(sitecopy -h | command grep -e '--\w' |\
awk '{sub (/=(FILE|PATH)/, "", $2); print $2}')" -- "$cur" ) )

View File

@ -72,7 +72,7 @@ _smartctl()
_split_longopt && split=true
case "$prev" in
case $prev in
-q|--quietmode)
_smartctl_quietmode
;;

View File

@ -55,7 +55,7 @@ _ssh_suboption()
# Split into subopt and subval
local prev=${1%%=*} cur=${1#*=}
case "$prev" in
case $prev in
BatchMode|ChallengeResponseAuthentication|CheckHostIP|\
ClearAllForwardings|Compression|ExitOnForwardFailure|ForwardAgent|\
ForwardX11|ForwardX11Trusted|GatewayPorts|GSSAPIAuthentication|\
@ -123,7 +123,7 @@ _ssh()
_ssh_suboption_check && return 0
case "$prev" in
case $prev in
-F|-i|-S)
_filedir
return 0
@ -201,7 +201,7 @@ _sftp()
_ssh_suboption_check && return 0
case "$prev" in
case $prev in
-b|-F|-P)
_filedir
return 0
@ -322,7 +322,7 @@ _scp()
return 0
}
case "$prev" in
case $prev in
-l|-P)
return 0
;;
@ -368,7 +368,7 @@ _scp()
shift
done
case "$cur" in
case $cur in
-*)
COMPREPLY=( $( compgen -W '-1 -2 -4 -6 -B -C -c -F -i -l -o \
-P -p -q -r -S -v' -- "$cur" ) )
@ -400,7 +400,7 @@ _ssh_copy_id()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-i)
_filedir
return 0

View File

@ -13,7 +13,7 @@ _tar()
return 0
fi
case "${COMP_WORDS[1]}" in
case ${COMP_WORDS[1]} in
?(-)[cr]*f)
_filedir
return 0

View File

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

View File

@ -25,7 +25,7 @@ _update_alternatives()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
--altdir|--admindir)
_filedir -d
return 0

View File

@ -4,7 +4,7 @@ have vncviewer &&
_vncviewer_bootstrap()
{
local fname
case "$(_realcommand vncviewer)" in
case $(_realcommand vncviewer) in
*xvnc4viewer) fname=_xvnc4viewer ;;
*tightvncviewer) fname=_tightvncviewer ;;
*) fname=_known_hosts ;;

View File

@ -149,7 +149,7 @@ _iwpriv()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
roam)
COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
return 0

View File

@ -13,7 +13,7 @@ _cdrecord()
if [[ "$cur" == *=* ]]; then
prev=${cur/=*/}
cur=${cur/*=/}
case "$prev" in
case $prev in
textfile|cuefile)
_filedir
return 0

View File

@ -5,7 +5,7 @@ _xhost ()
{
local cur=`_get_cword`
case "$cur" in
case $cur in
+*) _known_hosts_real -p+ "${cur:1}" ;;
-*) _known_hosts_real -p- "${cur:1}" ;;
*) _known_hosts_real "$cur" ;;

View File

@ -9,7 +9,7 @@ _xmllint()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-o|--output)
_filedir
return 0

View File

@ -9,7 +9,7 @@ _xmlwf()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
-d)
_filedir -d
return 0

View File

@ -8,7 +8,7 @@ _xrandr()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
case $prev in
--output)
local outputs=$(xrandr|awk '/connected/ {print $1}')
COMPREPLY=( $(compgen -W "$outputs" -- "$cur"))
@ -28,7 +28,7 @@ _xrandr()
;;
esac
case "$cur" in
case $cur in
*)
COMPREPLY=( $(compgen -W '-display -help --orientation --query \
--size --rate --version -x -y --screen --verbose --dryrun \

View File

@ -22,7 +22,7 @@ _xz()
local xspec="*.@(xz|lzma)"
case "$prev" in
case $prev in
--decompress|--list|--test|!(-*)[dlt]*)
xspec="!"$xspec
;;
@ -75,7 +75,7 @@ _xzdec()
local split=false
_split_longopt && split=true
case "$prev" in
case $prev in
-M|--memory)
# argument required but no completions available
return 0