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

PATCH: Re: Bug#239975: diff tab completion broken for second dir



> joey:~>mkdir a b
> joey:~>diff --exclude=foo --exclude=bar -ur a <tab><tab>
> --exclude-from              -X  -- exclude files matching pattern in file      
> --expand-tabs               -t  -- expand tabs to spaces                       
> --forward-ed                    -- output a reversed ed script                 
> --from-file                     -- compare specified file to all operands
> 
> For some reason if there are two --exclude's on the command line, it gets
> confused, and doesn't realize that the second non-option argument is supposed
> to be a file/directory.

That's because the diff completion doesn't know that you can use
-x/--exclude more than once.  I wonder if this is the only option
mis-specified thusly.

Index: Completion/Unix/Type/_diff_options
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_diff_options,v
retrieving revision 1.7
diff -u -r1.7 _diff_options
--- Completion/Unix/Type/_diff_options	14 Nov 2003 11:56:56 -0000	1.7
+++ Completion/Unix/Type/_diff_options	25 Mar 2004 16:45:27 -0000
@@ -90,7 +90,7 @@
     '(-N --new-file)'{-N,--new-file}'[treat absent files as empty]' \
     '(-P --unidirectional-new-file)'{-P,--unidirectional-new-file}'[treat absent first files as empty]' \
     '(-s --report-identical-files)'{-s,--report-identical-files}'[report when two files are the same]' \
-    '(-x --exclude)'{-x+,--exclude=}'[exclude files matching pattern]:exclusion pattern' \
+    \*{-x+,--exclude=}'[exclude files matching pattern]:exclusion pattern' \
     '(-X --exclude-from)'{-X+,--exclude-from=}'[exclude files matching pattern in file]:exclude file:_files' \
     '(-S --starting-file)'{-S+,--starting-file=}'[set first file in comparison]:start with file:_files' \
     '(--to-file)--from-file=[compare specified file to all operands]:from file:_files' \



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