dotfiles/.local/bin/scripts/dif
2022-05-11 12:18:47 +02:00

6 lines
411 B
Bash
Executable file

#!/bin/sh
# interactive diff with pagination and nice coloring
if file --mime "$1" "$2" | grep --quiet audio
then $(test $(tput cols) -gt 120 && echo "diff --color=always --side-by-side" || echo "diff-color") --label="$1" --label="$2" <(ffprobe -hide_banner "$1" 2>&1 | tail +2) <(ffprobe -hide_banner "$2" 2>&1 | tail +2 )
else diff-color "$@"
fi | less --RAW-CONTROL-CHARS --quit-on-intr --quit-if-one-screen