Merge pull request #5 from Varpie/colors

Adding colors using tput, thanks!
This commit is contained in:
Lukáš Mešťan 2016-10-15 12:17:56 +02:00 committed by GitHub
commit 3d778753a8

8
pert
View file

@ -12,6 +12,11 @@ function _echoB
_echo "\033[1m$1\033[0m" _echo "\033[1m$1\033[0m"
} }
red=$(tput setaf 1)
green=$(tput setaf 2)
yellow=$(tput setaf 3)
normal=$(tput sgr0)
function _help function _help
{ {
_echo "" _echo ""
@ -42,7 +47,7 @@ function _divider
printf "%$width.${width}s+\n" "$divider" printf "%$width.${width}s+\n" "$divider"
} }
readonly format=" | %-12s |%11s |%10s |%12s |%9s |%9s |%9s |\n" readonly format=" | %-12s |${green}%11s${normal} |%10s |${red}%12s${normal} |%9s |${yellow}%9s${normal} |%9s |\n"
function _header function _header
{ {
_echo "" _echo ""
@ -53,6 +58,7 @@ function _header
_divider _divider
} }
function pert_table function pert_table
{ {
_header _header