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

strange "diff -u" completion



 Hello,

 Using zsh 4.3.2 under both Debian Linux and Cygwin trying to complete the
command line after entering "diff -u2 oldfile" results in options being
completed, not "new file". This is because in the file
/usr/share/zsh/4.3.2/functions/Completion/Unix/_diff_options the "-u"
option is explicitly treated differently from "-U" and "--unified" which
are defined, in the list of options passed to _arguments, as taking an
optional parameter, but "-u" isn't. IMO this is wrong as "-u" behaves in
exactly the same way as "-U". But OTOH this has been clearly done on
purpose so there might be something I'm missing.

 Anyhow, if this is not intentional, it would be great if the following
patch could be applied:

--- /usr/share/zsh/4.3.2/functions/Completion/Unix/_diff_options        2006-11-24 05:36:03.000000000 +0100
+++ /home/zeitlin/zsh/_diff_options     2007-11-17 17:33:46.000000000 +0100
@@ -54,8 +54,6 @@
     '--strip-trailing-cr[strip trailing carriage return on input]' \
     '(-a --text)'{-a,--text}'[treat all files as text]' \
-    "($of $oss)"{-C+,--context=-}'[output a context diff]:number of lines of copied context' \
-    "($of $oss)-c[output a context diff]" \
-    "($of $oss)"{-U+,--unified=-}'[output a unified diff]:number of lines of unified context' \
-    "($of $oss)-u[output a unified diff]" \
+    "($of $oss)"{-c+,-C+,--context=-}'[output a context diff]:number of lines of copied context' \
+    "($of $oss)"{-u+,-U+,--unified=-}'[output a unified diff]:number of lines of unified context' \
     "($ofwuc $oss)*"{-L+,--label=}'[set label to use instead of file name]:label' \
     "($ofwuc $oss -p --show-c-function)"{-p,--show-c-function}'[show C function of each change]' \

 Thanks,
VZ



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