Skip to main content

text/pp_xml.sh

1#!/usr/bin/env bash
3set -o errexit
4set -o nounset
6# Check if we're running in a Terminal -- only pretty print the response
7# with colours if so.
8if [ -t 1 ]
9then
10 echo "terminal"
11 xmllint --format - | pygmentize -l xml
12else
13 xmllint --format -
14fi