mirror of
https://github.com/moparisthebest/pacman
synced 2024-11-04 16:45:07 -05:00
colourize colon_printf and question
Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
6582f68c9d
commit
e8130b8f2c
@ -1495,7 +1495,7 @@ static int question(short preset, const char *format, va_list args)
|
|||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
|
||||||
fprintf(stream, ":: ");
|
fputs(config->colstr.colon, stream);
|
||||||
vfprintf(stream, format, args);
|
vfprintf(stream, format, args);
|
||||||
|
|
||||||
if(preset) {
|
if(preset) {
|
||||||
@ -1504,6 +1504,9 @@ static int question(short preset, const char *format, va_list args)
|
|||||||
fprintf(stream, " %s ", _("[y/N]"));
|
fprintf(stream, " %s ", _("[y/N]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fputs(config->colstr.nocolor, stream);
|
||||||
|
fflush(stream);
|
||||||
|
|
||||||
if(config->noconfirm) {
|
if(config->noconfirm) {
|
||||||
fprintf(stream, "\n");
|
fprintf(stream, "\n");
|
||||||
return preset;
|
return preset;
|
||||||
@ -1562,11 +1565,13 @@ int colon_printf(const char *fmt, ...)
|
|||||||
int ret;
|
int ret;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
fputs(":: ", stdout);
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
|
fputs(config->colstr.colon, stdout);
|
||||||
ret = vprintf(fmt, args);
|
ret = vprintf(fmt, args);
|
||||||
|
fputs(config->colstr.nocolor, stdout);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
|
fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user