mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
- Added support for "task stop <id>" command, that removes the start time from a task.
- Updated documentation accordingly.
This commit is contained in:
parent
47c02965e9
commit
0987171280
8 changed files with 46 additions and 6 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue