diff --git a/clc b/clc index 45876d8..1aaac1b 100755 --- a/clc +++ b/clc @@ -5,20 +5,20 @@ clc() { local close="${close:-\e[0m}" if [ $# -eq 0 ]; then - clc_parse + clc_parse "" else case "${1}" in - -v|--version) echo 'v2.1.0';; + -v|--version) echo 'v2.1.1';; -e|--escape) shift case "${1}" in - zsh) shift; open='%%{\e[%bm%%}'; close='%%{\e[0m%%}';; + zsh) shift; open='%%{\e[%bm%%}'; close='%{\e[0m%}';; bash) shift; open='\[\e[%bm\]'; close='\[\e[0m\]';; *) shift; open='\001\e[%bm\002'; close='\001\e[0m\002';; esac clc "$@" ;; - *) printf '%s' "$@" | clc + *) printf '%b' "$@" | clc esac fi } @@ -40,7 +40,8 @@ clc_parse_directive() { printf "${open}" $( for directive in "${directives[@]}"; do directive=(${directive//\#/rgbhex }) - eval clc_code_${directive[@]} + eval clc_code_${directive[0]} "${directive[@]:1}" + printf '%b' '\n' done | paste -sd ';' - ) }