summaryrefslogtreecommitdiff
path: root/.local/bin/lessopen.sh
blob: df4a58edc175af3812b9e91a5109e3c2db4bb328 (plain)
1
2
3
4
5
6
7
8
9
#!/bin/sh

[ -d "$1" ] && { tree -CL 3 "$1"; exit; }

if command -V highlight >/dev/null; then
	highlight --force --out-format=ansi -- "$1"
else
	cat "$1"
fi