Add complementary hint :holidays/no-holidays

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2021-12-20 22:12:54 +01:00
parent 1a6d5cacca
commit 4044635e08
3 changed files with 5 additions and 2 deletions

View file

@ -29,6 +29,7 @@ Default value is 'no'
**reports.summary.holidays**::
Determines whether relevant holidays are shown beneath the report.
Can be overridden by the ':holidays' and ':no-holidays' hint, respectively.
Default value is 'yes'.
**reports.summary.ids**::

View file

@ -190,11 +190,11 @@ int CmdSummary (
table.set (table.addRow (), (show_ids ? 8 : 7) + offset, " ", Color ("underline"));
table.set (table.addRow (), (show_ids ? 8 : 7) + offset, Duration (grand_total).formatHours ());
const auto with_holidays = rules.getBoolean ("reports.summary.holidays");
const auto show_holidays = cli.getComplementaryHint ("holidays", rules.getBoolean ("reports.summary.holidays"));
std::cout << '\n'
<< table.render ()
<< (with_holidays ? renderHolidays (createHolidayMap (rules, filter)) : "")
<< (show_holidays ? renderHolidays (createHolidayMap (rules, filter)) : "")
<< '\n';
return 0;

View file

@ -98,6 +98,8 @@ void initializeEntities (CLI& cli)
cli.entity ("hint", ":no-ids");
cli.entity ("hint", ":annotations");
cli.entity ("hint", ":no-annotations");
cli.entity ("hint", ":holidays");
cli.entity ("hint", ":no-holidays");
cli.entity ("hint", ":lastmonth");
cli.entity ("hint", ":lastquarter");
cli.entity ("hint", ":lastweek");