diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index 6451a7125..0d6439e85 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -540,6 +540,12 @@ Taskwarrior supports command aliases. This alias provides an alternate name any of the commands. Several commands you may use are actually aliases - the 'history' report, for example, or 'export'. +.TP +.B burndown.cumulative=0 +May be "1" or "0", and controls the behaviour of the burndown command. When set +to 1, it sums up all completed tasks, otherwise they only get plotted in the +interval where the task was completed. Defaults to 1. + .SS DATES .TP diff --git a/src/commands/CmdBurndown.cpp b/src/commands/CmdBurndown.cpp index 380c8fd7a..37a23c10e 100644 --- a/src/commands/CmdBurndown.cpp +++ b/src/commands/CmdBurndown.cpp @@ -235,7 +235,17 @@ void Chart::scan (std::vector & tasks) Datetime now; time_t epoch; - bool cumulative = !Context::getContext ().config.getBoolean ("burndown.nc"); + auto& config = Context::getContext ().config; + bool cumulative; + if (config.has ("burndown.cumulative")) + { + cumulative = config.getBoolean ("burndown.cumulative"); + } + else + { + cumulative = true; + } + for (auto& task : tasks) { // The entry date is when the counting starts. diff --git a/test/burndown.t b/test/burndown.t index c000a3131..a39454210 100755 --- a/test/burndown.t +++ b/test/burndown.t @@ -66,7 +66,7 @@ class TestBurndownCommand(TestCase): def test_burndown_daily_non_cumulative(self): """Ensure burndown.daily in non-cumulative mode generates a chart""" - self.t.config("burndown.nc", True) + self.t.config("burndown.cumulative", False) code, out, err = self.t("burndown.daily") self.assertIn("Daily Burndown", out) self.assertIn(".", out)