mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-17 10:20:55 +01: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
|
||||
|
||||
_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
|
||||
|
||||
(( $+_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 \
|
||||
|
|
|
@ -136,7 +136,7 @@ else
|
|||
'(--new)-N[compare new files against empty files]' \
|
||||
"(-P)--exclude-project-file[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' \
|
||||
'*:file or directory:_files'
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue