zsh-workers
 help / color / Atom feed
* [PATCH] _diff_options doesn't support -w/--ignore-all-space for GNU diff
@ 2020-02-06 16:05 Martin von Wittich
  2020-02-06 19:32 ` dana
  0 siblings, 1 reply; 2+ messages in thread
From: Martin von Wittich @ 2020-02-06 16:05 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

I'm using GNU diff 3.7 and zsh 5.7.1 as provided by Debian 10.2, and I noticed that zsh's completion doesn't support diffs -w/--ignore-all-space parameter. This is pretty annoying, because it means that it won't complete "new file" in this case:

diff -uw old new<TAB>

It'll think that -uw is "old file", and that "old" is "new file". I don't fully understand the _diff_options completion script, so my change might probably not be completely correct, but the attached patch fixes it for me.

Martin

[-- Warning: decoded text below may be mangled --]
[-- Attachment #2: _diff_options.patch --]
[-- Type: text/x-diff; name=_diff_options.patch, Size: 467 bytes --]

--- _diff_options	2019-02-05 01:18:01.000000000 +0100
+++ /usr/share/zsh/functions/Completion/Unix/_diff_options	2020-02-06 16:57:25.785300505 +0100
@@ -82,6 +82,7 @@
       '--palette=[specify colors to use]:color:_diff_palette'
       "($of $ouc)--side-by-side[output in two columns]"
       "($of $ouc)-y[output in two columns]"
+      '(-w --ignore-all-space)'{-w,--ignore-all-space}'[ignore all white space]'
     )
   else
     args+=( '!--speed-large-files' )

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] _diff_options doesn't support -w/--ignore-all-space for GNU diff
  2020-02-06 16:05 [PATCH] _diff_options doesn't support -w/--ignore-all-space for GNU diff Martin von Wittich
@ 2020-02-06 19:32 ` dana
  0 siblings, 0 replies; 2+ messages in thread
From: dana @ 2020-02-06 19:32 UTC (permalink / raw)
  To: Martin von Wittich; +Cc: Zsh hackers list

On 6 Feb 2020, at 10:05, Martin von Wittich <martin.von.wittich@iserv.eu> wrote:
> I'm using GNU diff 3.7 and zsh 5.7.1 as provided by Debian 10.2, and I
> noticed that zsh's completion doesn't support diffs -w/--ignore-all-space
> parameter.

It looks like this was lost when support for the new FreeBSD diff was added in
workers/43351. I've restored that option (for both GNU and FreeBSD), thanks.

There are still some issues with this function, though. For one thing, the new
FreeBSD diff is heavily based on (almost but not quite identical to)
OpenBSD's, so we should probably add OpenBSD into the existing GNU/FreeBSD
mix. I think there are also some option-name inconsistencies between GNU and
the BSDs, but i didn't look super hard. My free time is pretty tied up in
getting 5.8 out right now, but maybe i'll look into this again, some day, if
nobody else does.

dana


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-06 16:05 [PATCH] _diff_options doesn't support -w/--ignore-all-space for GNU diff Martin von Wittich
2020-02-06 19:32 ` dana

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git