Bug Fix - limit:

- The limit: attribute can now be specified on the command line, to
  override any custom report filter.
This commit is contained in:
Paul Beckingham 2009-06-18 18:34:40 -04:00
parent af606598fa
commit b9a1993692
5 changed files with 14 additions and 25 deletions

View file

@ -90,6 +90,10 @@ std::string handleCustomReport (const std::string& report)
context.sequence.combine (sequence);
// Allow limit to be overridden by the command line.
if (!context.task.has ("limit") && task.has ("limit"))
context.task.set ("limit", task.get ("limit"));
foreach (att, filter)
context.filter.push_back (*att);
}
@ -462,15 +466,10 @@ std::string handleCustomReport (const std::string& report)
// Limit the number of rows according to the report definition.
int maximum = context.config.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 the custom report has a defined limit, then allow a numeric override.
// This is an integer specified on the command line (task oldest 4), which is
// parsed as an ID.
if (context.config.get (std::string ("report.") + report + ".limit", (int)0) != 0)
if (context.sequence.size () == 1)
maximum = context.sequence[0];
// This is an integer specified as a filter (limit:10).
if (context.task.has ("limit"))
maximum = ::atoi (context.task.get ("limit").c_str ());
std::stringstream out;
if (table.rowCount ())