mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-10 04:00:37 +02:00
commands: Colorize only if color=on is set
Commands 'columns', 'commands' and 'custom' would output color escape sequences desipte color=off being set.
This commit is contained in:
parent
44afdb89e3
commit
e0a808a6ba
4 changed files with 32 additions and 17 deletions
|
@ -76,12 +76,15 @@ int CmdColumns::execute (std::string& output)
|
|||
formats.add (Column::factory ("string", STRING_COLUMN_LABEL_STYLES));
|
||||
formats.add (Column::factory ("string", STRING_COLUMN_LABEL_EXAMPLES));
|
||||
|
||||
Color label (context.config.get ("color.label"));
|
||||
formats.colorHeader (label);
|
||||
if (context.color ())
|
||||
{
|
||||
Color label (context.config.get ("color.label"));
|
||||
formats.colorHeader (label);
|
||||
|
||||
Color alternate (context.config.get ("color.alternate"));
|
||||
formats.colorOdd (alternate);
|
||||
formats.intraColorOdd (alternate);
|
||||
Color alternate (context.config.get ("color.alternate"));
|
||||
formats.colorOdd (alternate);
|
||||
formats.intraColorOdd (alternate);
|
||||
}
|
||||
|
||||
for (auto& name : names)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue