mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
Helper Command
- Added _query helper command for script writers, which accepts a filter like any other report, but returns raw JSON.
This commit is contained in:
parent
126a3d88b5
commit
7f32435ce9
8 changed files with 72 additions and 0 deletions
23
src/Task.cpp
23
src/Task.cpp
|
@ -423,6 +423,29 @@ std::string Task::composeYAML () const
|
|||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string Task::composeJSON () const
|
||||
{
|
||||
std::stringstream out;
|
||||
out << "{";
|
||||
|
||||
std::map <std::string, Att>::const_iterator i;
|
||||
for (i = this->begin (); i != this->end (); ++i)
|
||||
{
|
||||
if (i != this->begin ())
|
||||
out << ",";
|
||||
|
||||
out << "\""
|
||||
<< i->second.name ()
|
||||
<< "\":\""
|
||||
<< i->second.value ()
|
||||
<< "\"";
|
||||
}
|
||||
|
||||
out << "}";
|
||||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Task::getAnnotations (std::vector <Att>& annotations) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue