aboutsummaryrefslogtreecommitdiff
path: root/files/.lessfilter.sh
diff options
context:
space:
mode:
Diffstat (limited to 'files/.lessfilter.sh')
-rwxr-xr-xfiles/.lessfilter.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/files/.lessfilter.sh b/files/.lessfilter.sh
new file mode 100755
index 0000000..86d6833
--- /dev/null
+++ b/files/.lessfilter.sh
@@ -0,0 +1,9 @@
+#!/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 ;;
+esac
+
+exit 1