dotfiles/.local/bin/scripts/dif

9 lines
567 B
Plaintext
Raw Normal View History

2022-07-06 09:14:31 +00:00
#!/bin/bash -e
2021-07-29 14:02:20 +00:00
# interactive diff with pagination and nice coloring
2022-09-16 12:48:43 +00:00
# TODO diff sqlite repos with sqldiff
2022-07-06 09:14:31 +00:00
if file --brief --mime "$1" "$2" | grep --quiet audio
2022-05-11 11:18:27 +00:00
then ff() { ffprobe -loglevel warning -print_format default=noprint_wrappers=1 -show_format -pretty "$@"; }
2022-06-13 13:49:14 +00:00
$(test $(tput cols) -gt 120 && echo "diff --color=always --side-by-side" || echo "diff-color") --report-identical-files --label="$1" --label="$2" <(ff "$1") <(ff "$2")
else wiked-diff "$@" # diff-color --report-identical-files "$@"
2022-05-11 10:18:47 +00:00
fi | less --RAW-CONTROL-CHARS --quit-on-intr --quit-if-one-screen