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

Re: PATCH for _diff_options to allow argument to -u



On 19 Apr, Ulrik Haugen wrote:
> Hello!
> 
> I recently discovered that you can control the amount of context that
> diff -u or -c gives you. Shortly thereafter it became very annoying
> that the zsh completion sees characters (other than other option
> characters) immediately following -u (or -c) as the original file name
> and thus won't complete the new file once you get as far as "diff -u0
> orig". The patch below makes the completion treat them the same way
> the option handling in diff does.

You should probably get used to using -U or --unified for specifying
lines of context. With diffutils 2.8.1 it works with -u but with
diffutils 2.8.4, I get this:

% diff -u0
diff: `-0' option is obsolete; use `-U 0'

The completion function is correct for the newer diffutils so I'll leave
the function as it is.

Oliver



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