[pacman-dev] coloured pacman
Roman Kyrylych
roman.kyrylych at gmail.com
Tue Feb 6 16:34:51 EST 2007
2007/2/6, Vojtěch Gondžala <vogo at seznam.cz>:
> OK, i make new
> diff(http://www.fi.muni.cz/~xgondz/pacman3-color/pacman3-color.diff), I hope
> that is correct.
>
> The function color is colouring a string only when descriptor is a tty, it's
> querying via function isatty.
>
> I thing, when a string will be colouring in function pm_fprintf must be
> overlay function fprintf and that isn't a trifle.
>
> I can keep this patch out of pacman, when you think that color output in
> console isn't good idea, it isn't problem ;-).
Unified diffs look much better. :)
My thoughts:
snprintf(tr, LOG_STR_LEN, color(2, . . .))
fprintf(color(2, . . .))
MSG(NL, color(1, . . .))
ERR(NL, color(2, . . .))
looks not very good, I hope in 3.1 this can be cleaned, so calling
color function could be integrated in some new unified msg function.
Then C_WHITE, C_DEFAULT could be eliminated too - coloring should be
set per message type (class), not per each message.
With improved messages output in 3.1 your patch will be much smaller then.
--
Roman Kyrylych (Роман Кирилич)
More information about the pacman-dev
mailing list