From c94222d3c29789909f761aff31777bdc5b036c9c Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Sun, 17 Apr 2022 20:23:44 +0430 Subject: bunch of stuff --- lesscolor.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lesscolor.sh') 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 -- cgit v1.2.3