From c2943574773ad1584f1d868a1a2d38266af7dde4 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sat, 11 Mar 2000 00:08:11 +0000 Subject: zsh-workers/10058 --- Completion/User/_diff_options | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'Completion/User/_diff_options') diff --git a/Completion/User/_diff_options b/Completion/User/_diff_options index 5f5f70738..d5d16ad55 100644 --- a/Completion/User/_diff_options +++ b/Completion/User/_diff_options @@ -2,23 +2,20 @@ local of ofwuc ouc oss ofwy ofwg ofwl cmd -(( $+_diff_is_gnu )) || typeset -gA _diff_is_gnu +(( $+_is_gnu )) || typeset -gA _is_gnu -if (( ! $+_diff_is_gnu[$words[1]] )); then - if [[ "$words[1]" = *diff ]]; then - cmd="$words[1]" - else - cmd=diff - fi +cmd="$1" +shift +if (( ! $+_is_gnu[$cmd] )); then if [[ $(_call version $cmd -v /dev/null) = *GNU* ]]; then - _diff_is_gnu[$words[1]]=yes + _is_gnu[$cmd]=yes else - _diff_is_gnu[$words[1]]= + _is_gnu[$cmd]= fi fi -if [[ -n "$_diff_is_gnu[$words[1]]" ]]; then +if [[ -n "$_is_gnu[$cmd]" ]]; 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