about summary refs log tree commit diff
path: root/Completion/User
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/User')
-rw-r--r--Completion/User/_cvs13
1 files changed, 9 insertions, 4 deletions
diff --git a/Completion/User/_cvs b/Completion/User/_cvs
index df519f900..1cdbed4b3 100644
--- a/Completion/User/_cvs
+++ b/Completion/User/_cvs
@@ -35,11 +35,14 @@ _cvs_command () {
   if (( CURRENT == 1 )); then
     compadd "$@" ${(k)cmds} || compadd "$@" ${(kv)=cmds}
   else
-    _cvs_"${${(k)cmds[(R)* $words[1] *]}:-$words[1]}" 2>&- ||
-      _message "unknown cvs command: $words[1]"
+    _cvs_"${${(k)cmds[(R)* $words[1] *]}:-${words[1]:#*~(${(@kj:|:)~cmds})}}"
   fi
 }
 
+_cvs_ () {
+  _message "unknown cvs command: $words[1]"
+}
+
 # define completion functions for each cvs command
 
 builtin functions _cvs_add >&- ||
@@ -582,9 +585,11 @@ _cvs_files_unmaintained () {
 
 # define configuration variables.
 
+local tmp
+
 (( $+_cvs_roots )) ||
-if [[ -f ~/.cvspass ]]; then
-  _cvs_roots=(${${(f)"$(<~/.cvspass)"}%% *})
+if [[ -f "${tmp::=${CVS_PASSFILE:-$HOME/.cvspass}}" ]]; then
+  _cvs_roots=(${${(f)"$(<$tmp)"}%% *})
 else
   _cvs_roots=()
 fi