2021-01-07 12:01:15 +01:00
|
|
|
#!/bin/sh
|
2021-07-29 16:02:20 +02:00
|
|
|
# interactive diff with pagination and nice coloring
|
2022-05-11 12:18:47 +02:00
|
|
|
if file --mime "$1" "$2" | grep --quiet audio
|
2022-05-11 13:18:27 +02:00
|
|
|
then ff() { ffprobe -loglevel warning -print_format default=noprint_wrappers=1 -show_format -pretty "$@"; }
|
|
|
|
$(test $(tput cols) -gt 120 && echo "diff --color=always --side-by-side" || echo "diff-color") --label="$1" --label="$2" <(ff "$1") <(ff "$2")
|
2022-05-11 12:18:47 +02:00
|
|
|
else diff-color "$@"
|
|
|
|
fi | less --RAW-CONTROL-CHARS --quit-on-intr --quit-if-one-screen
|