about summary refs log tree commit diff
path: root/Completion/User
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-03-10 11:17:05 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-03-10 11:17:05 +0000
commit388e580449468b7b111594e3e206ac42beafc82c (patch)
tree8b1c8a3ca3a2c4d8232161d79fa7e05f2d9d91fd /Completion/User
parent09cfde0a69cc6a84845ba11b01e21da277934da0 (diff)
downloadzsh-388e580449468b7b111594e3e206ac42beafc82c.tar.gz
zsh-388e580449468b7b111594e3e206ac42beafc82c.tar.xz
zsh-388e580449468b7b111594e3e206ac42beafc82c.zip
zsh-workers/10040
Diffstat (limited to 'Completion/User')
-rw-r--r--Completion/User/_diff_options24
1 files changed, 17 insertions, 7 deletions
diff --git a/Completion/User/_diff_options b/Completion/User/_diff_options
index 4d994acb6..5f5f70738 100644
--- a/Completion/User/_diff_options
+++ b/Completion/User/_diff_options
@@ -1,14 +1,24 @@
 #autoload
 
-local of ofwuc ouc oss ofwy ofwg ofwl
+local of ofwuc ouc oss ofwy ofwg ofwl cmd
 
-(( $+_diff_is_gnu )) || {
-	_diff_is_gnu=0;
-        [[ $(_call version diff -v </dev/null 2>/dev/null) == *GNU* ]] && _diff_is_gnu=1
-}
+(( $+_diff_is_gnu )) || typeset -gA _diff_is_gnu
 
-if (( _diff_is_gnu ))
-then
+if (( ! $+_diff_is_gnu[$words[1]] )); then
+  if [[ "$words[1]" = *diff ]]; then
+    cmd="$words[1]"
+  else
+    cmd=diff
+  fi
+
+  if [[ $(_call version $cmd -v </dev/null 2>/dev/null) = *GNU* ]]; then
+    _diff_is_gnu[$words[1]]=yes
+  else
+    _diff_is_gnu[$words[1]]=
+  fi
+fi
+
+if [[ -n "$_diff_is_gnu[$words[1]]" ]]; then
   # output formats 
   of="-y --side-by-side -n --rcs -e -f --ed -q --brief -c -C --context -u -U \
   --unified --old-group-format --new-group-format --changed-group-format \