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

Re: need for a fancier _pick_variant?



In the last episode (Oct 22), Bart Schaefer said:
> [ I've been busy and then away, so catching up on some old stuff. ]
> 
> On Oct 13, 11:29pm, Danek Duvall wrote:
> }
> } _diff_options calls
> } 
> }     _pick_variant -c diff 'gnu=GNU' unix -v
> } 
> } which doesn't match anything for Solaris diff, so the generic unix diff
> } options are chosen, and the result is thrown by the -u.
> }
> } Unfortunately, I don't know of any way of distinguishing Solaris diff by
> } its output, short of a brittle check of its usage statement.
> 
> I don't have access to a Solaris machine.  Does `diff -v` produce the
> usage message?  If so, I suggest that you use the "brittle" test just

Solaris 2.8 and older don't have -u:
/usr/bin/diff: illegal option -- v
usage: diff [-bitw] [-c | -e | -f | -h | -n] file1 file2
       diff [-bitw] [-C number] file1 file2
       diff [-bitw] [-D string] file1 file2
       diff [-bitw] [-c | -e | -f | -h | -n] [-l] [-r] [-s] [-S name] directory1 directory2

2.9 does:
/usr/bin/diff: illegal option -- v
usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 file2
       diff [-bitw] [-C number | -U number] file1 file2
       diff [-bitw] [-D string] file1 file2
       diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] [-s] [-S name] directory1 directory2

-- 
	Dan Nelson
	dnelson@xxxxxxxxxxxxxxx



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