summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Gomizelj <simongmzlj@gmail.com>2013-03-06 17:53:04 +0100
committerAllan McRae <allan@archlinux.org>2013-03-07 06:55:04 +0100
commite8130b8f2cf540bb0ad12afc552b2774a0ca5a83 (patch)
tree68c6ef9c76d1f12a9b1e456ff223c0f4f29cd392 /src
parent6582f68c9d8c36806b2450540cf2dea87c930177 (diff)
downloadpacman-e8130b8f2cf540bb0ad12afc552b2774a0ca5a83.tar.gz
pacman-e8130b8f2cf540bb0ad12afc552b2774a0ca5a83.tar.xz
colourize colon_printf and question
Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/util.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 22fdb361..d503073a 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -1495,7 +1495,7 @@ static int question(short preset, const char *format, va_list args)
fflush(stdout);
fflush(stderr);
- fprintf(stream, ":: ");
+ fputs(config->colstr.colon, stream);
vfprintf(stream, format, args);
if(preset) {
@@ -1504,6 +1504,9 @@ static int question(short preset, const char *format, va_list args)
fprintf(stream, " %s ", _("[y/N]"));
}
+ fputs(config->colstr.nocolor, stream);
+ fflush(stream);
+
if(config->noconfirm) {
fprintf(stream, "\n");
return preset;
@@ -1562,11 +1565,13 @@ int colon_printf(const char *fmt, ...)
int ret;
va_list args;
- fputs(":: ", stdout);
va_start(args, fmt);
+ fputs(config->colstr.colon, stdout);
ret = vprintf(fmt, args);
+ fputs(config->colstr.nocolor, stdout);
va_end(args);
+ fflush(stdout);
return ret;
}