From 3ee196ac6879d1da95607b1070b12561926b0b7b Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Wed, 20 Aug 2014 21:32:09 +0200 Subject: Bash config: add arch-diff function (self-explanatory) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Pokorný --- .bashrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.bashrc b/.bashrc index c96d63f..0ce9e28 100644 --- a/.bashrc +++ b/.bashrc @@ -158,6 +158,14 @@ img-diff() { xloadimage <(compare "$1" "$2" -highlight-color violet -lowlight-color darkgray -compose threshold -) } +arch-diff() { + [ $# -lt 2 ] && int-usage "[-v]" "1st-archive" "2nd-archive" && return + test $# -gt 2 && test "$1" = "-v" \ + && { colordiff -du <(tar -tvf "$2" | sort -k5) <(tar -tvf "$3" | sort -k5) \ + || return $?; } \ + || colordiff -du <(tar -tf "$1" | sort) <(tar -tf "$2" | sort) +} + img-qr() { local title="Piped: " [ $# -ge 1 ] \ -- cgit