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

Re: support more arguments to diff

On 18 April 2018 at 02:22, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> Eitan Adler wrote:
>> >> I'd also like to port this particular diff implementation to the other
>> >> BSDs, hence adding all of them to the case statement.
>> >
>> > I think it would be best to add the other cases as each BSD adopts
>> > whichever diff. I generally try to update the completion to match
>> > -current, so when a new release is picked up the options are correct.
>> I also wonder if we could just get rid of the OS test and replace it
>> with a pure version test. What if we run different verrsions than the
>> default?
> Yes, detecting the version first is usually best. Arguably, this is what
> we already do with $OSTYPE being a fallback; we have:
>   _pick_variant -c $cmd gnu=GNU unix -v
> Does this new diff produce a helpful signature by which it can be
> identified if run as diff -v

Annoyingly no, but that seems easy to fix.
∴diff -V
diff: invalid option -- V

> I'm not fond of the patch in the form that was posted.

What about just adding FreeBSD then?

> If you want a temporary workaround while using 12-CURRENT, I'd recommend
> setting: _cmd_variant[diff]=gnu

I'll use that for now.

Eitan Adler

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