#!/bin/sh
#
# dependencies: colour-diff-output

if [ -t 1 ]; then
  # connected to a tty => use glorious technicolour and paging
  # this gawk -f/which combination makes us platform-agnostic by relying on $PATH twice.
  # shellcheck disable=SC2312
  exec gawk -f "$(command -v colour-diff-output)" | diff-less "$@"
else
  # probably piping to a file, use black and white
  exec cat
fi
