Skip to content

Commit

Permalink
misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
betafcc committed May 24, 2021
1 parent b50113c commit 26dda56
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions clc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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 ';' -
)
}
Expand Down

0 comments on commit 26dda56

Please sign in to comment.