[pacman-dev] [PATCH 07/16] introduce colstr for colourizing

Simon Gomizelj simongmzlj at gmail.com
Mon Mar 4 17:28:58 EST 2013


This makes implementing `colon_printf` easier.

    printf("%s ", colstr.colon);
    printf(fmt, args);
    ...

instead of

    printf("%s::%s ", colstr.colon, colstr.title);
    printf(fmt, args);
    ...

I can change it if you guys prefer but I figured setting colstr.colon
like this would minimize the amount of work that needs to be done at
pretty print time.

(That said, to be consistent with my argument, I should probably add
that whitespace to colstr.colon too.)

>> +static void init_colors(int colors)
>> +{
>> +     if(colors == PM_COLOR_ON) {
>> +             colstr.colon = BOLDBLUE "::" BOLDWHITE;

> Why add "::" here instead of making this a plain color like all of the
> other members and adding "::" in colon_printf?


More information about the pacman-dev mailing list