Clipboard syntax highlighting (MacOS)

#!/bin/bash -eo pipefail

pbpaste | pygmentize -l $1 -f rtf | pbcopy -Prefer rtf

Usage: syntax.sh python