Merge pull request #5 from Varpie/colors
Adding colors using tput, thanks!
This commit is contained in:
commit
3d778753a8
1 changed files with 33 additions and 27 deletions
8
pert
8
pert
|
|
@ -12,6 +12,11 @@ function _echoB
|
|||
_echo "\033[1m$1\033[0m"
|
||||
}
|
||||
|
||||
red=$(tput setaf 1)
|
||||
green=$(tput setaf 2)
|
||||
yellow=$(tput setaf 3)
|
||||
normal=$(tput sgr0)
|
||||
|
||||
function _help
|
||||
{
|
||||
_echo ""
|
||||
|
|
@ -42,7 +47,7 @@ function _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
|
||||
{
|
||||
_echo ""
|
||||
|
|
@ -53,6 +58,7 @@ function _header
|
|||
_divider
|
||||
}
|
||||
|
||||
|
||||
function pert_table
|
||||
{
|
||||
_header
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue