- Added support for "task stop <id>" command, that removes the start time from a task.

- Updated documentation accordingly.
This commit is contained in:
Paul Beckingham 2008-10-19 11:47:03 -04:00
parent 47c02965e9
commit 0987171280
8 changed files with 46 additions and 6 deletions

View file

@ -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)
{