mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Enhancement - annotate
- Implemented annotation command.
This commit is contained in:
parent
23f0a9658e
commit
051720a279
2 changed files with 17 additions and 15 deletions
|
@ -192,9 +192,7 @@ std::string Context::dispatch ()
|
||||||
else if (cmd.command == "" && task.getId ()) { out = handleModify (); }
|
else if (cmd.command == "" && task.getId ()) { out = handleModify (); }
|
||||||
*/
|
*/
|
||||||
else if (cmd.command == "append") { out = handleAppend (); }
|
else if (cmd.command == "append") { out = handleAppend (); }
|
||||||
/*
|
|
||||||
else if (cmd.command == "annotate") { out = handleAnnotate (); }
|
else if (cmd.command == "annotate") { out = handleAnnotate (); }
|
||||||
*/
|
|
||||||
else if (cmd.command == "done") { out = handleDone (); }
|
else if (cmd.command == "done") { out = handleDone (); }
|
||||||
else if (cmd.command == "undo") { out = handleUndo (); }
|
else if (cmd.command == "undo") { out = handleUndo (); }
|
||||||
else if (cmd.command == "delete") { out = handleDelete (); }
|
else if (cmd.command == "delete") { out = handleDelete (); }
|
||||||
|
|
|
@ -1041,31 +1041,35 @@ std::string handleColor ()
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
std::string handleAnnotate ()
|
std::string handleAnnotate ()
|
||||||
{
|
{
|
||||||
/*
|
if (!context.task.has ("description"))
|
||||||
if (task.getDescription () == "")
|
|
||||||
throw std::string ("Cannot apply a blank annotation.");
|
throw std::string ("Cannot apply a blank annotation.");
|
||||||
*/
|
|
||||||
|
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
/*
|
|
||||||
std::vector <T> all;
|
|
||||||
tdb.pendingT (all);
|
|
||||||
filterSequence (all, task);
|
|
||||||
|
|
||||||
foreach (t, all)
|
std::vector <Task> tasks;
|
||||||
|
context.tdb.lock (context.config.get ("locking", true));
|
||||||
|
context.tdb.loadPending (tasks, context.filter);
|
||||||
|
|
||||||
|
// Filter sequence.
|
||||||
|
context.filter.applySequence (tasks, context.sequence);
|
||||||
|
|
||||||
|
foreach (task, tasks)
|
||||||
{
|
{
|
||||||
t->addAnnotation (task.getDescription ());
|
task->addAnnotation (context.task.get ("description"));
|
||||||
tdb.modifyT (*t);
|
context.tdb.update (*task);
|
||||||
|
|
||||||
if (context.config.get ("echo.command", true))
|
if (context.config.get ("echo.command", true))
|
||||||
out << "Annotated "
|
out << "Annotated "
|
||||||
<< t->getId ()
|
<< task->id
|
||||||
<< " with '"
|
<< " with '"
|
||||||
<< t->getDescription ()
|
<< task->get ("description")
|
||||||
<< "'"
|
<< "'"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
context.tdb.commit ();
|
||||||
|
context.tdb.unlock ();
|
||||||
|
|
||||||
return out.str ();
|
return out.str ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue