#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG  				#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
# Copyright Christopher Roy Bratušek			#
#							#
#########################################################

. gettext.sh
export TEXTDOMAIN="bashstyle-rc"

check P xmlindent xmlpager || exit 1

case ${1} in
	-h | --help )
		bashstyle-help -a "hackerb9" -e "" -h "http://www.commandlinefu.com/"\
			-l "GNU GPL v3" -n "xmlpager" -s "$(eval_gettext "pager for xml files with highlighted text")"\
			-v "${BSNG_VERSION}" -y "${BSNG_YEAR}"\
			-o "$(eval_gettext "file:|xml file to read")"
	;;

	*)
		xmlindent "${@}" | \
			awk '{gsub(">",">'"$(tput bold; tput setf 4)"'"); gsub("<","'"$(tput sgr0)"'<"); print;} END {print "'"$(tput sgr0)"'"}' | \
			less -r
	;;
esac
