aboutsummaryrefslogtreecommitdiffstats
path: root/lesscolor.sh
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-04-17 15:53:44 +0000
committerterminaldweller <thabogre@gmail.com>2022-04-17 15:53:44 +0000
commitc94222d3c29789909f761aff31777bdc5b036c9c (patch)
treed1749737e9209556493a61e435dbae3371dba407 /lesscolor.sh
parentupdate (diff)
downloadscripts-c94222d3c29789909f761aff31777bdc5b036c9c.tar.gz
scripts-c94222d3c29789909f761aff31777bdc5b036c9c.zip
bunch of stuff
Diffstat (limited to '')
-rwxr-xr-xlesscolor.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/lesscolor.sh b/lesscolor.sh
index 069126e..4a8dc93 100755
--- a/lesscolor.sh
+++ b/lesscolor.sh
@@ -1,14 +1,14 @@
#!/usr/bin/env bash
get_interp() {
- shebang=$(head -1 $1)
+ shebang=$(head -1 "$1")
IFS='/' read -ra arr_slash <<< "$shebang"
IFS=' ' read -ra arr_space <<< "${arr_slash[-1]}"
-
+
if [[ ${arr_space[0]} == "env" ]];then
- echo ${arr_space[1]}
+ echo "${arr_space[1]}"
else
- echo ${arr_space[0]}
+ echo "${arr_space[0]}"
fi
}
@@ -62,10 +62,11 @@ case "$1" in
*.feature|*.tap|*.awk|*.vim|*.pot|*.po|*.weechatlog|*.todotxt|*.thy|\
*.lean|*.rts|*.u|*.vcl|*.bpl|*.sil|*.vpr|*.cirru|*.duel|*.jbst|*.qml|\
*.qbs|*.slim|*.xqy|*.xquery|*.xq|*.xql|*.xqm|*.whiley|*.x10)
- pygmentize -f 256 -O style=$PYGMENTIZE_STYLE "$1"|nl -b a;;
+ pygmentize -f 256 -O style="$PYGMENTIZE_STYLE" "$1" | nl -b a;;
*)
- interp=$(get_interp $1)
- pygmentize -f 256 -O style=$PYGMENTIZE_STYLE -l $interp "$1"|nl -b a
+ # interp=$(get_interp "$1")
+ # pygmentize -f 256 -O style="$PYGMENTIZE_STYLE" -l "$interp" "$1" | nl -b a
+ pygmentize -f 256 -O style="$PYGMENTIZE_STYLE" -g "$1" | nl -b a
esac
exit 0