summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-08-20 21:32:09 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-08-20 21:32:09 +0200
commit3ee196ac6879d1da95607b1070b12561926b0b7b (patch)
tree8222c1cb0c1013b6d206dc6cae8b435fe2042d2c
parent2f05f3c435106208feea502840d00841bfcc2aa5 (diff)
downloaddotfiles-3ee196ac6879d1da95607b1070b12561926b0b7b.zip
dotfiles-3ee196ac6879d1da95607b1070b12561926b0b7b.tar.gz
dotfiles-3ee196ac6879d1da95607b1070b12561926b0b7b.tar.xz
Bash config: add arch-diff function (self-explanatory)
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--.bashrc8
1 files changed, 8 insertions, 0 deletions
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 ] \