diff --git a/src/commands/CmdHelp.cpp b/src/commands/CmdHelp.cpp index db5e416f..714ffcc3 100644 --- a/src/commands/CmdHelp.cpp +++ b/src/commands/CmdHelp.cpp @@ -216,6 +216,9 @@ int CmdHelp (const CLI& cli) << " :quiet Turns off all feedback. For automation\n" << " :debug Runs in debug mode, shows many runtime details\n" << "\n" + << " :color Force color on, even if not connected to a TTY\n" + << " :nocolor Force color off, even if connected to a TTY\n" + << "\n" << " :day The 24-hours of the current day\n" << " :week This week\n" << " :month This month\n" diff --git a/src/init.cpp b/src/init.cpp index a4db1aa4..2699a3d0 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -80,6 +80,8 @@ void initializeEntities (CLI& cli) cli.entity ("hint", ":quarter"); cli.entity ("hint", ":year"); cli.entity ("hint", ":fill"); + cli.entity ("hint", ":color"); + cli.entity ("hint", ":nocolor"); } //////////////////////////////////////////////////////////////////////////////// @@ -89,14 +91,18 @@ void initializeDataAndRules ( Rules& rules) { // Make common hints available via rules: - // :debug --> debug - // :quiet --> verbose + // :debug --> debug=on + // :quiet --> verbose=off + // :color --> color=on + // :nocolor --> color=off for (auto& arg : cli._args) { if (arg.hasTag ("HINT")) { - if (arg.attribute ("canonical") == ":debug") rules.set ("debug", "on"); - if (arg.attribute ("canonical") == ":quiet") rules.set ("verbose", "off"); + if (arg.attribute ("canonical") == ":debug") rules.set ("debug", "on"); + if (arg.attribute ("canonical") == ":quiet") rules.set ("verbose", "off"); + if (arg.attribute ("canonical") == ":color") rules.set ("color", "on"); + if (arg.attribute ("canonical") == ":nocolor") rules.set ("color", "coff"); } }