cvs: Rename get_* helper functions to _cvs_*.

This commit is contained in:
Ville Skyttä 2011-05-24 23:12:29 +03:00
parent 44dd868077
commit f186fc00fc

View File

@ -2,7 +2,7 @@
have cvs || return have cvs || return
get_entries() _cvs_entries()
{ {
local prefix=${cur%/*}/ IFS=$'\n' local prefix=${cur%/*}/ IFS=$'\n'
[[ -e ${prefix:-}CVS/Entries ]] || prefix="" [[ -e ${prefix:-}CVS/Entries ]] || prefix=""
@ -13,7 +13,7 @@ get_entries()
fi fi
} }
get_modules() _cvs_modules()
{ {
if [ -n "$prefix" ]; then if [ -n "$prefix" ]; then
COMPREPLY=( $( command ls -d ${cvsroot}/${prefix}/!(CVSROOT) ) ) COMPREPLY=( $( command ls -d ${cvsroot}/${prefix}/!(CVSROOT) ) )
@ -147,7 +147,7 @@ _cvs()
esac esac
if [[ "$cur" != -* ]]; then if [[ "$cur" != -* ]]; then
get_entries _cvs_entries
[ -z "$cur" ] && files=( !(CVS) ) || \ [ -z "$cur" ] && files=( !(CVS) ) || \
files=( $( command ls -d ${cur}* 2>/dev/null ) ) files=( $( command ls -d ${cur}* 2>/dev/null ) )
local f local f
@ -187,7 +187,7 @@ _cvs()
if [[ "$cur" = -* ]]; then if [[ "$cur" = -* ]]; then
_cvs_command_options "$1" $mode _cvs_command_options "$1" $mode
else else
get_entries _cvs_entries
COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) )
fi fi
;; ;;
@ -197,7 +197,7 @@ _cvs()
if [[ "$cur" = -* ]]; then if [[ "$cur" = -* ]]; then
_cvs_command_options "$1" $mode _cvs_command_options "$1" $mode
else else
get_entries _cvs_entries
COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) )
fi fi
;; ;;
@ -251,7 +251,7 @@ _cvs()
COMPREPLY=( $( compgen -W '${changed[@]:-} \ COMPREPLY=( $( compgen -W '${changed[@]:-} \
${newremoved[@]:-}' -- "$cur" ) ) ${newremoved[@]:-}' -- "$cur" ) )
else else
get_entries _cvs_entries
COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) )
fi fi
else else
@ -289,13 +289,13 @@ _cvs()
_cvs_command_options "$1" $mode _cvs_command_options "$1" $mode
[[ $COMPREPLY == *= ]] && compopt -o nospace [[ $COMPREPLY == *= ]] && compopt -o nospace
else else
get_entries _cvs_entries
COMPREPLY=( $( compgen -W '${entries[@]:-}' -- "$cur" ) ) COMPREPLY=( $( compgen -W '${entries[@]:-}' -- "$cur" ) )
fi fi
;; ;;
remove) remove)
if [[ "$cur" != -* ]]; then if [[ "$cur" != -* ]]; then
get_entries _cvs_entries
# find out what files are missing # find out what files are missing
for i in "${entries[@]}"; do for i in "${entries[@]}"; do
[ ! -r "$i" ] && miss+=( $i ) [ ! -r "$i" ] && miss+=( $i )
@ -321,7 +321,7 @@ _cvs()
[ -z "$cvsroot" ] && cvsroot=$CVSROOT [ -z "$cvsroot" ] && cvsroot=$CVSROOT
local prefix=${cur%/*} local prefix=${cur%/*}
if [ -r ${cvsroot}/${prefix} ]; then if [ -r ${cvsroot}/${prefix} ]; then
get_modules _cvs_modules
COMPREPLY=( ${COMPREPLY[@]#$cvsroot} ) COMPREPLY=( ${COMPREPLY[@]#$cvsroot} )
COMPREPLY=( ${COMPREPLY[@]#\/} ) COMPREPLY=( ${COMPREPLY[@]#\/} )
fi fi
@ -346,7 +346,7 @@ _cvs()
if [[ "$cur" = -* ]]; then if [[ "$cur" = -* ]]; then
_cvs_command_options "$1" $mode _cvs_command_options "$1" $mode
else else
get_entries _cvs_entries
COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) )
fi fi
;; ;;