summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-05-05 16:17:38 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-05-05 16:17:38 +0000
commitea333ddca6184d03be02be1f826f51b9207817e2 (patch)
tree37e413b75831e5f213770754fcdbbc05abc80421
parentc3f2434dfa7b620e73b13edb03a56c90be4a1f44 (diff)
downloadzsh-ea333ddca6184d03be02be1f826f51b9207817e2.tar.gz
zsh-ea333ddca6184d03be02be1f826f51b9207817e2.tar.xz
zsh-ea333ddca6184d03be02be1f826f51b9207817e2.zip
11213: Completion/User/_cvs: don't complete files which is
already on command line for `cvs add', `cvs remove' and `cvs commit'.
-rw-r--r--ChangeLog3
-rw-r--r--Completion/User/_cvs10
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e4e5bdbd4..fe62162c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-05-05  Tanaka Akira  <akr@zsh.org>
 
+	* 11213: Completion/User/_cvs: don't complete files which is
+	already on command line for `cvs add', `cvs remove' and `cvs commit'.
+
 	* 11204: Completion/User/_look: use more precise explanation and
 	complete an optional second argument.
 
diff --git a/Completion/User/_cvs b/Completion/User/_cvs
index ce928fe50..3fbc70894 100644
--- a/Completion/User/_cvs
+++ b/Completion/User/_cvs
@@ -7,7 +7,7 @@ _cvs () {
   _arguments -s \
     -{a,f,H,l,n,Q,q,r,t,v,w,x} \
     '--version' '--help' '--help-commands' '--help-synonyms' '--help-options' \
-    '--allow-root=:rootdir:_files -/' \
+    '*--allow-root=:rootdir:_files -/' \
     '-b+:bindir:_cvs_bindir' \
     '-T+:temporary directory:_cvs_tempdir' \
     '-d+:cvsroot:_cvs_root' \
@@ -601,6 +601,10 @@ _cvs_files_modified () {
   _cvs_setup_prefix
   if [[ -d ${pref}CVS ]]; then
     _cvs_setup_modentries
+    setopt localoptions unset
+    local omit
+    omit=($line)
+    eval 'entries=(${entries:#('${(j:|:)${(@)omit:q}}')})'
     (( $#entries )) && _files "$@" -g "${(j:|:)${(@)entries:q}}"
   else
     _files "$@"
@@ -615,7 +619,7 @@ _cvs_files_removed () {
     _cvs_setup_allentries
     setopt localoptions unset
     local omit
-    omit=(${pref}*(D:t))
+    omit=(${pref}*(D:t) $line)
     eval 'entries=(${entries:#('${(j:|:)${(@)omit:q}}')})'
     _tags directories && compadd "$@" -P "$qpref" - ${entries:q} ||
         _cvs_directories "$@"
@@ -632,7 +636,7 @@ _cvs_files_unmaintained () {
     _cvs_setup_allentries
     setopt localoptions unset
     local omit
-    omit=($_cvs_ignore_default ${entries:q} ${=cvsignore})
+    omit=($_cvs_ignore_default ${entries:q} ${=cvsignore} $line)
     [[ -r ~/.cvsignore ]] && omit=($omit $(<~/.cvsignore))
     [[ -r ${pref}.cvsignore ]] && omit=($omit $(<${pref}.cvsignore))
     _path_files "$@" -g '*~(*/|)('${(j:|:)omit}')(D)' ||