- Added support for "task stop <id>" command, that removes the start time from a task.
- Updated documentation accordingly.
This commit is contained in:
@@ -441,6 +441,36 @@ void handleStart (TDB& tdb, T& task, Config& conf)
|
||||
throw std::string ("Task not found.");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void handleStop (TDB& tdb, T& task, Config& conf)
|
||||
{
|
||||
std::vector <T> all;
|
||||
tdb.pendingT (all);
|
||||
|
||||
std::vector <T>::iterator it;
|
||||
for (it = all.begin (); it != all.end (); ++it)
|
||||
{
|
||||
if (it->getId () == task.getId ())
|
||||
{
|
||||
T original (*it);
|
||||
|
||||
if (original.getAttribute ("start") != "")
|
||||
{
|
||||
original.removeAttribute ("start");
|
||||
original.setId (task.getId ());
|
||||
tdb.modifyT (original);
|
||||
|
||||
nag (tdb, task, conf);
|
||||
return;
|
||||
}
|
||||
else
|
||||
std::cout << "Task " << task.getId () << " not started." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
throw std::string ("Task not found.");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void handleDone (TDB& tdb, T& task, Config& conf)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user