Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

CVS completion for 'forced commit'



Hi,


I have been using ZSH for just over a year now and I am really
impressed!  Well done all those involved.  Previously I have mainly used
TCSH and so getting ZSH completion to work "my" way was important to me.
So far the one thing that has really rattled my chain is that completion
does not work for `cvs commit -f`.  I have only very briefly looked at
the documentation for completion - ENOTIME - so the patch I am about to
suggest is probably wrong. :-)  However, it does appear to work.

+===+===+===+===+===+===+===+

--- zsh/4.3.4/functions/Completion/Unix/_cvs.orig       2007-10-06 07:10:48.000000000 +0100
+++ zsh/4.3.4/functions/Completion/Unix/_cvs    2008-01-11 15:37:52.000000000 +0000
@@ -170,9 +170,19 @@
     '(-F)-m+[message]:message:_cvs_m' \
     '(-m)-F+[message file]:log message file:_files' \
     '-r+[specify revision]:tag:_cvs_revisions' \
-    '*:modified file:_cvs_files_modified'
+    '*:modified file:_cvs_commit_arg'
 }
 
+(( $+functions[_cvs_commit_arg] )) ||
+_cvs_commit_arg() {
+  if (( $+opt_args[-f] )); then
+    _cvs_files
+  else
+    _cvs_files_modified
+  fi
+}
+
+(( $+functions[_cvs_rtag] )) ||
 (( $+functions[_cvs_diff] )) ||
 _cvs_diff() {
   local of ofwuc ouc oss ofwy ofwg ofwl

+===+===+===+===+===+===+===+

Is the above right?  Nearly right?


Cheers,
       Nick.
-- 



Messages sorted by: Reverse Date, Date, Thread, Author