]> granicus.if.org Git - sysstat/commit
Add color support: Common functions and definitions
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 12 Sep 2015 14:50:50 +0000 (16:50 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 12 Sep 2015 14:50:50 +0000 (16:50 +0200)
commit974cb5873a8803d262c98b50df02d427894172fd
treef5bda25d3cf98b2f654b360966bec9eb120d8d37
parent12d4fea6150b851e5a3c04b2a0cd912d47f83671
Add color support: Common functions and definitions

Add color support.
Colors will be used when S_COLORS environment variable is set (later,
this variable could contain the path to a file to allow user to cutomize
colors).
For now, a value of zero will be printed in faint yellow, whereas a non
zero value will be printed in bold yellow.
Percentages values are handled differently when they are greater than
50: A value greater than 75% is printed in bold red, or printed in bold
blue if greater than 50%.

Each sysstat command needs now to be modified to take into account these
new rules.

Colorization could also be applied to time stamps, headers, etc.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
common.c
common.h