comparison bin/termcolors.sh @ 145:c3ca45204c4e

Documentation.
author Edho Arief <edho@myconan.net>
date Sun, 02 Oct 2011 04:28:49 +0700
parents 1783152a1fe6
children 73e90355bbd7
comparison
equal deleted inserted replaced
144:1783152a1fe6 145:c3ca45204c4e
1 #!/bin/sh 1 #!/bin/sh
2
3 # Usage:
4 # _c [bold_|]<color> <text>
5 #
6 # <color> can be one of:
7 # black, blue, green, cyan, red, purple, brown, gray
8 # Prefix the color with bold_ to use bold style/light color.
9 #
10 # Example:
11 # To print word "Hello" in bold blue:
12 # _c bold_blue "Hello"
13 #
14 # To print text with only one word colored:
15 # echo "Hello, $(c green world)."
16 #
17 # To do:
18 # Support for background color, underline, etc.
19 #
2 20
3 _c() { 21 _c() {
4 color_name="${1}" 22 color_name="${1}"
5 shift 23 shift
6 text="${*}" 24 text="${*}"