From c8c7a5137473770eb4b2d9d54495c2a39b32cbe3 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Fri, 1 Mar 2013 14:27:40 -0500 Subject: add a config settings and flag for colours Colours can be enabled in two ways: - Add Color to pacman.conf. This enables colours automatically. - Use --color=WHEN where WHEN is none/auto/always. WHEN as 'never' disables colours (overrides config file), as 'auto' enables colours when stdout is a tty, and 'always' enables colours no matter what. Signed-off-by: Simon Gomizelj Signed-off-by: Allan McRae --- src/pacman/conf.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/pacman/conf.h') diff --git a/src/pacman/conf.h b/src/pacman/conf.h index d85d11f2..6cabd33e 100644 --- a/src/pacman/conf.h +++ b/src/pacman/conf.h @@ -34,6 +34,7 @@ typedef struct __config_t { unsigned short print; unsigned short checkspace; unsigned short usesyslog; + unsigned short color; double deltaratio; char *arch; char *print_format; @@ -129,7 +130,8 @@ enum { OP_PRINTFORMAT, OP_GPGDIR, OP_DBONLY, - OP_FORCE + OP_FORCE, + OP_COLOR }; /* clean method */ @@ -145,6 +147,11 @@ enum { PKG_LOCALITY_FOREIGN = (1 << 1) }; +enum { + PM_COLOR_UNSET = 0, + PM_COLOR_OFF, + PM_COLOR_ON +}; /* global config variable */ extern config_t *config; -- cgit v1.2.3-24-g4f1b