diff options
author | Karel Zak | 2013-05-06 19:07:23 +0200 |
---|---|---|
committer | Karel Zak | 2013-05-06 19:07:23 +0200 |
commit | a10c0434932d41e6e83119ca807a6c2d07b7a044 (patch) | |
tree | 5a74e446104b3ec4d35949520b0cfeb2ffff5890 /include/colors.h | |
parent | su: consistent angular brackets and lowercase in help text of 'su' (diff) | |
download | kernel-qcow2-util-linux-a10c0434932d41e6e83119ca807a6c2d07b7a044.tar.gz kernel-qcow2-util-linux-a10c0434932d41e6e83119ca807a6c2d07b7a044.tar.xz kernel-qcow2-util-linux-a10c0434932d41e6e83119ca807a6c2d07b7a044.zip |
lib/colors: add support for auto, always and never modes
... to implement --color[=<when>]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/colors.h')
-rw-r--r-- | include/colors.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/colors.h b/include/colors.h index dd77bf6df..f9e36fd57 100644 --- a/include/colors.h +++ b/include/colors.h @@ -38,8 +38,19 @@ #define UL_COLOR_WHITE "\033[1;37m" +/* --color[=WHEN] */ +enum colortmode { + UL_COLORMODE_AUTO = 0, + UL_COLORMODE_NEVER, + UL_COLORMODE_ALWAYS, + + __UL_NCOLORMODES /* last */ +}; + +extern int colormode_from_string(const char *str); + /* Initialize the global variable OUT_IS_TERM */ -extern int colors_init(void); +extern int colors_init(int mode); /* Set the color to CLR_SCHEME */ extern void color_enable(const char *clr_scheme); |