diff options
Diffstat (limited to 'Completion/User/_diff_options')
-rw-r--r-- | Completion/User/_diff_options | 17 |
1 files changed, 7 insertions, 10 deletions
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 2>/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 \ |