mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Enhancement - Custom report limit override
- If a custom report has a specified limit to the number of tasks it shows, then that limit may be overridden by specifying a new quantity on the command line. - Added unit tests to verify expected behavior. - Updated documentation to reflect new functionality. - Removed obsolete documentation references to an "oldest" and "newest" configuration variable.
This commit is contained in:
parent
72f84b3c3e
commit
1c736a319d
6 changed files with 79 additions and 29 deletions
|
@ -2521,8 +2521,18 @@ std::string handleCustomReport (
|
|||
}
|
||||
}
|
||||
|
||||
// Limit the number of rows according to the report definition.
|
||||
int maximum = conf.get (std::string ("report.") + report + ".limit", (int)0);
|
||||
|
||||
// If the custom report has a defined limit, then allow an override, which
|
||||
// will show up as a single ID sequence.
|
||||
if (conf.get (std::string ("report.") + report + ".limit", (int)0) != 0)
|
||||
{
|
||||
std::vector <int> sequence = task.getAllIds ();
|
||||
if (sequence.size () == 1)
|
||||
maximum = sequence[0];
|
||||
}
|
||||
|
||||
std::stringstream out;
|
||||
if (table.rowCount ())
|
||||
out << optionalBlankLine (conf)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue