aboutsummaryrefslogtreecommitdiff
path: root/files/.lessfilter.sh
blob: 9580bf6cf8e70d00868ed4f10fdda04754b457f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

case $1 in
    *.xml) if [ -x `which xmlstarlet 2>/dev/null` ]; then exec xmlstarlet fo "$1"; fi ;;
    *.json) if [ -x `which jq 2>/dev/null` ]; then exec jq -C . "$1"; fi ;;
    *.md) if [ -x `which pandoc 2>/dev/null` ]; then exec pandoc -t plain "$1"; fi ;;
    *) exec /bin/lesspipe "$1";;
esac

exit 1