From 388e580449468b7b111594e3e206ac42beafc82c Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 10 Mar 2000 11:17:05 +0000 Subject: zsh-workers/10040 --- Completion/User/_diff_options | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'Completion/User') 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) == *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) = *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 \ -- cgit 1.4.1