mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
zsh-workers/10058
This commit is contained in:
parent
c8c717c2bb
commit
c294357477
3 changed files with 9 additions and 12 deletions
|
@ -1,3 +1,3 @@
|
||||||
#compdef diff gdiff
|
#compdef diff gdiff
|
||||||
|
|
||||||
_diff_options ':original file:_files' ':new file:_files'
|
_diff_options "$words[1]" ':original file:_files' ':new file:_files'
|
||||||
|
|
|
@ -2,23 +2,20 @@
|
||||||
|
|
||||||
local of ofwuc ouc oss ofwy ofwg ofwl cmd
|
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
|
cmd="$1"
|
||||||
if [[ "$words[1]" = *diff ]]; then
|
shift
|
||||||
cmd="$words[1]"
|
|
||||||
else
|
|
||||||
cmd=diff
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
if (( ! $+_is_gnu[$cmd] )); then
|
||||||
if [[ $(_call version $cmd -v </dev/null 2>/dev/null) = *GNU* ]]; then
|
if [[ $(_call version $cmd -v </dev/null 2>/dev/null) = *GNU* ]]; then
|
||||||
_diff_is_gnu[$words[1]]=yes
|
_is_gnu[$cmd]=yes
|
||||||
else
|
else
|
||||||
_diff_is_gnu[$words[1]]=
|
_is_gnu[$cmd]=
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$_diff_is_gnu[$words[1]]" ]]; then
|
if [[ -n "$_is_gnu[$cmd]" ]]; then
|
||||||
# output formats
|
# output formats
|
||||||
of="-y --side-by-side -n --rcs -e -f --ed -q --brief -c -C --context -u -U \
|
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 \
|
--unified --old-group-format --new-group-format --changed-group-format \
|
||||||
|
|
|
@ -136,7 +136,7 @@ else
|
||||||
'(--new)-N[compare new files against empty files]' \
|
'(--new)-N[compare new files against empty files]' \
|
||||||
"(-P)--exclude-project-file[don't diff the project file]" \
|
"(-P)--exclude-project-file[don't diff the project file]" \
|
||||||
"(--exclude-project-file)-P[don't diff the project file]" \
|
"(--exclude-project-file)-P[don't diff the project file]" \
|
||||||
'--[introduce diff options]:*::diff options: _diff_options' \
|
'--[introduce diff options]:*::diff options: _diff_options ${PRCS_DIFF_COMMAND:-diff}' \
|
||||||
':project name:_prcs_projects' \
|
':project name:_prcs_projects' \
|
||||||
'*:file or directory:_files'
|
'*:file or directory:_files'
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue