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

Re: PATCH: _diff



In article <38A2B5EB.20014972@xxxxxxxxxxxxx>,
  Oliver Kiddle <opk@xxxxxxxxxxxxx> writes:

> -	_diff_is_gnu=0;
> -        [[ $(command diff -v </dev/null) == *GNU* ]] && _diff_is_gnu=1
> +	_diff_is_gnu=0
> +        [[ $(command diff -v >/dev/null 2>&1) == *GNU* ]] &&
> _diff_is_gnu=1

Since this (and Bart's equivalent) makes always _diff_is_gnu 0,
_diff_options completes always non-GNUish options as:

Z(2):akr@is27e1u11% Src/zsh -f
is27e1u11% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
is27e1u11% diff -v
diff - GNU diffutils version 2.7
is27e1u11% diff -<TAB>
-b -- skip trailing white spaces
-c -- output a context diff
-e -- output an ed script
-f -- output a reversed ed script
-r -- recursively compare subdirectories

So, following patch should be applied instead of 9654/9667.

Index: Completion/User/_diff_options
===================================================================
RCS file: /projects/zsh/zsh/Completion/User/_diff_options,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 _diff_options
--- Completion/User/_diff_options	2000/01/27 20:09:32	1.1.1.2
+++ Completion/User/_diff_options	2000/02/11 15:22:10
@@ -4,7 +4,7 @@
 
 (( $+_diff_is_gnu )) || {
 	_diff_is_gnu=0;
-        [[ $(command diff -v </dev/null) == *GNU* ]] && _diff_is_gnu=1
+        [[ $(command diff -v </dev/null 2>/dev/null) == *GNU* ]] && _diff_is_gnu=1
 }
 
 if (( _diff_is_gnu ))
-- 
Tanaka Akira



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