///////////////////////////////////////////////////////////////////////////
| 55 | |
| 56 | //////////////////////////////////////////////////////////////////////////////// |
| 57 | int CmdIDs::execute(std::string& output) { |
| 58 | // Apply filter. |
| 59 | Filter filter; |
| 60 | std::vector<Task> filtered; |
| 61 | filter.subset(filtered); |
| 62 | |
| 63 | // Find number of matching tasks. |
| 64 | std::vector<int> ids; |
| 65 | for (auto& task : filtered) |
| 66 | if (task.id) ids.push_back(task.id); |
| 67 | |
| 68 | std::sort(ids.begin(), ids.end()); |
| 69 | output = compressIds(ids) + '\n'; |
| 70 | |
| 71 | Context::getContext().headers.clear(); |
| 72 | return 0; |
| 73 | } |
| 74 | |
| 75 | //////////////////////////////////////////////////////////////////////////////// |
| 76 | // The vector must be sorted first. This is a modified version of the run- |