about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2001-05-04 17:16:54 +0000
committerBart Schaefer <barts@users.sourceforge.net>2001-05-04 17:16:54 +0000
commitf8f6c27650f6469ee8b1427c733f0967b94159d9 (patch)
tree0967df519bf74057600cfeac5552d6462329fcd6
parent070f2d98c3696b5ed3f2497eb33573841e1d75e8 (diff)
downloadzsh-f8f6c27650f6469ee8b1427c733f0967b94159d9.tar.gz
zsh-f8f6c27650f6469ee8b1427c733f0967b94159d9.tar.xz
zsh-f8f6c27650f6469ee8b1427c733f0967b94159d9.zip
Path prefix completion for cvs subcommands.
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_cvs28
2 files changed, 26 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index e90cfff90..7c216788f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-05-04  Bart Schaefer  <schaefer@zsh.org>
+
+	* 14224: Completion/Unix/Commmand/_cvs: Complete path prefixes for
+	subcommands where file completion must reference CVS/Entries.
+
 2001-05-04  Oliver Kiddle  <opk@zsh.org>
 
 	* 14219: Completion/Zsh/Command/_bindkey: update for bindkey
diff --git a/Completion/Unix/Command/_cvs b/Completion/Unix/Command/_cvs
index 8235c8d37..f649aa8e7 100644
--- a/Completion/Unix/Command/_cvs
+++ b/Completion/Unix/Command/_cvs
@@ -73,7 +73,7 @@ _cvs_add () {
   _arguments -s \
     '-k+[keyword]:keyword substitution:_cvs_k' \
     '-m+[message]:message:_cvs_m' \
-    '*:file:_cvs_files_unmaintained' \
+    '*:added file:_cvs_files_unmaintained' \
 }
 
 (( $+functions[_cvs_admin] )) ||
@@ -157,7 +157,7 @@ _cvs_commit () {
     '(-F)-m+[message]:message:_cvs_m' \
     '(-m)-F+[message file]:log message file:_files' \
     '-r+[specify revision]:tag:_cvs_revisions' \
-    '*:file:_cvs_files_modified'
+    '*:modified file:_cvs_files_modified'
 }
 
 (( $+functions[_cvs_diff] )) ||
@@ -434,7 +434,7 @@ _cvs_remove () {
     '-f[force to remove]' \
     '(-R)-l[don'\''t recursive]' \
     '(-l)-R[recursive]' \
-    '*:file:_cvs_remove_arg'
+    '*:removed file:_cvs_remove_arg'
 }
 
 (( $+functions[_cvs_remove_arg] )) ||
@@ -516,7 +516,7 @@ _cvs_update () {
     '(-D)-r+[specify revision]:tag:_cvs_revisions' \
     '(-r)-D+[specify date]:date:_cvs_D' \
     '-j+[merge]:tag:_cvs_revisions' \
-    '*-I+[ignore files]:name:_files' \
+    '*-I+[ignore files]:file:_files' \
     '*-W+[wrapper specification]:spec:_files' \
     '*:file:_cvs_files'
 }
@@ -856,7 +856,8 @@ _cvs_files_unmaintained () {
 (( $+functions[_cvs_existing_directories] )) ||
 _cvs_existing_directories () {
   local expl
-  _wanted files expl file _path_files -g "*~(*/|)CVS(/)"
+  _wanted directories expl directory _path_files -g "*~(*/|)CVS(/)" ||
+  _cvs_path_prefixes
 }
 
 (( $+functions[_cvs_existing_entries] )) ||
@@ -881,7 +882,7 @@ _cvs_modified_entries () {
     realdir=${(e)~linedir}
     [[ -f "$realdir"CVS/Entries ]] &&
     [[ -n ${pat::="${(@j:|:)${(@)${(@)${(@)${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}/\\/[^\\/]#\\///}%/[^/]#/[^/]#}:#${(j:|:)~${${${${(f)"$(LC_ALL=C builtin stat -gn +mtime -F '%a %b %e %T %Y' ${realdir}*(D) 2>/dev/null)"}##*/}/ //}//(#m)[][*?()<|^~#\\]/\\$MATCH}}}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH}"} ]] &&
-    _wanted files expl file _path_files -g "$pat"
+    _wanted files expl 'modified file' _path_files -g "$pat"
   else
     _cvs_existing_entries
   fi
@@ -945,7 +946,20 @@ _cvs_nonexisting_entries () {
       ${${${${(M)${(f)"$(<"$realdir"CVS/Entries)"}:#(D|)/*}#(D|)/}%%/*}:#${(j:|:)~${files//(#m)[][*?()<|^~#\\]/\\$MATCH}}}
     )
     compquote files
-    _wanted files expl file compadd -Qp "$linedir" -a files
+    _wanted files expl 'removed file' compadd -Qp "$linedir" -a files
+  }
+}
+
+(( $+functions[_cvs_path_prefixes] )) ||
+_cvs_path_prefixes () {
+  local expl match
+  match=()
+  [[ "$PREFIX$SUFFIX" = (#b)(*)(/[^/]#) ]] && {
+    PREFIX="$match[1]"
+    ISUFFIX="$match[2]$ISUFFIX"
+    SUFFIX=''
+    _wanted directories expl directory \
+	_path_files -g "*~($PREFIX|(*/|)CVS)(/)" -S ''
   }
 }