Extract CVS roots completion into _cvs_roots().

This commit is contained in:
Ville Skyttä 2009-12-28 22:56:13 +02:00
parent f8a2d67783
commit f853e6a6a1

View File

@ -43,6 +43,15 @@ _cvs_kflags()
COMPREPLY=( $( compgen -W 'kv kvl k o b v' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'kv kvl k o b v' -- "$cur" ) )
} }
_cvs_roots()
{
if [ -r ~/.cvspass ]; then
# Ugly escaping because of bash treating ':' specially
cvsroots=$( sed -e 's/^[^ ]* //' -e 's/:/\\:/g' ~/.cvspass )
COMPREPLY=( $( compgen -W '$cvsroots' -- "$cur" ) )
fi
}
_cvs() _cvs()
{ {
local cur prev count mode i cvsroot cvsroots pwd local cur prev count mode i cvsroot cvsroots pwd
@ -252,11 +261,7 @@ _cvs()
fi fi
;; ;;
cvsroot) cvsroot)
if [ -r ~/.cvspass ]; then _cvs_roots
# Ugly escaping because of bash treating ':' specially
cvsroots=$( sed -e 's/^[^ ]* //' -e 's/:/\\:/g' ~/.cvspass )
COMPREPLY=( $( compgen -W '$cvsroots' -- "$cur" ) )
fi
;; ;;
export) export)
case "$prev" in case "$prev" in