mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TW-257
- TW-257 limit: not working properly (thanks to Aikido Guy).
This commit is contained in:
parent
7ac533a82d
commit
222c357c0a
2 changed files with 10 additions and 2 deletions
|
@ -47,6 +47,7 @@
|
|||
Harlan).
|
||||
- TW-255 'Mask' instead of 'iMask' shown in info report (thanks to Benjamin
|
||||
Weber)
|
||||
- TW-257 limit: not working properly (thanks to Aikido Guy).
|
||||
- TW-259 Hyphenated words are split when added (thanks to Ben Boeckel).
|
||||
- TW-261 Easy to create "not deletable" task (thanks to Jan Kunder).
|
||||
- TW-266 Allow project auto-completion to search completed tasks (thanks to
|
||||
|
|
|
@ -53,8 +53,11 @@ int CmdExport::execute (std::string& output)
|
|||
std::vector <Task> filtered;
|
||||
filter.subset (filtered);
|
||||
|
||||
// Note: "limit:" feature not supported.
|
||||
// TODO Why not?
|
||||
// Obey 'limit:N'.
|
||||
int rows = 0;
|
||||
int lines = 0;
|
||||
context.getLimits (rows, lines);
|
||||
int limit = (rows > lines ? rows : lines);
|
||||
|
||||
// Is output contained within a JSON array?
|
||||
bool json_array = context.config.getBoolean ("json.array");
|
||||
|
@ -63,6 +66,7 @@ int CmdExport::execute (std::string& output)
|
|||
if (json_array)
|
||||
output += "[\n";
|
||||
|
||||
int counter = 0;
|
||||
std::vector <Task>::iterator task;
|
||||
for (task = filtered.begin (); task != filtered.end (); ++task)
|
||||
{
|
||||
|
@ -70,6 +74,9 @@ int CmdExport::execute (std::string& output)
|
|||
output += ",\n";
|
||||
|
||||
output += task->composeJSON (true);
|
||||
|
||||
if (limit && ++counter >= limit)
|
||||
break;
|
||||
}
|
||||
|
||||
if (filtered.size ())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue