From: Elan Ruusamäe Date: Fri, 20 Mar 2015 11:56:07 +0000 (+0200) Subject: d: pass extra args to diff(1) X-Git-Tag: auto/th/rpm-build-tools-4.6-4~7 X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm-build-tools.git;a=commitdiff_plain;h=ea887a943ddba9fa2caa87a60e37139204c40441 d: pass extra args to diff(1) --- diff --git a/shrc.sh b/shrc.sh index 8e36984..aceec77 100755 --- a/shrc.sh +++ b/shrc.sh @@ -294,8 +294,8 @@ sed -e ' # does diff between FILE~ and FILE # the diff can be applied with patch -p1 d() { - local file="$1" - local dir diff + local file="$1" dir + shift if [[ "$file" = /* ]]; then # full path -- no idea where to strip dir=. @@ -306,7 +306,7 @@ d() { diff=${PWD##*/}/${file} fi - (builtin cd "$dir"; dif $diff{~,}) + (builtin cd "$dir"; dif $diff{~,} "$@") } # spec name from NVR