mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +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
|
@ -5,6 +5,7 @@
|
|||
+ Removed deprecated TUTORIAL file.
|
||||
+ Removed "usage" command, and support for "command.logging" configuration
|
||||
variable.
|
||||
+ "task stop" can now remove the start time from a started task.
|
||||
|
||||
------ old releases ------------------------------
|
||||
|
||||
|
|
|
@ -157,6 +157,11 @@ ID Project Pri Due Active Age Description
|
|||
"task start ..." command was run, as shown above.
|
||||
</p>
|
||||
|
||||
<strong>% task stop <id></strong>
|
||||
<p>
|
||||
Marks a task as inactive, by removing the start time.
|
||||
</p>
|
||||
|
||||
<strong>% task overdue</strong>
|
||||
<p>
|
||||
Simply lists all the task that have a due date that is past, in
|
||||
|
|
|
@ -99,6 +99,7 @@
|
|||
<li>Removed deprecated TUTORIAL file.
|
||||
<li>Removed "usage" command, and support for "command.logging" configuration
|
||||
variable.
|
||||
<li>"task stop" can remove the start time from a started task.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
task undelete ID
|
||||
task info ID
|
||||
task start ID
|
||||
task stop ID
|
||||
task done ID
|
||||
task undo ID
|
||||
task projects
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -138,6 +138,7 @@ static const char* commands[] =
|
|||
"projects",
|
||||
"start",
|
||||
"stats",
|
||||
"stop",
|
||||
"summary",
|
||||
"tags",
|
||||
"undelete",
|
||||
|
|
12
src/task.cpp
12
src/task.cpp
|
@ -125,7 +125,11 @@ static void shortUsage (Config& conf)
|
|||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task start ID");
|
||||
table.addCell (row, 2, "Marks specified task as started, starts the clock ticking");
|
||||
table.addCell (row, 2, "Marks specified task as started");
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task stop ID");
|
||||
table.addCell (row, 2, "Removes the 'start' time from a task");
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task done ID");
|
||||
|
@ -300,10 +304,6 @@ int main (int argc, char** argv)
|
|||
std::string dataLocation = expandPath (conf.get ("data.location"));
|
||||
tdb.dataDirectory (dataLocation);
|
||||
|
||||
// Log commands, if desired.
|
||||
if (conf.get ("command.logging") == "on")
|
||||
tdb.logCommand (argc, argv);
|
||||
|
||||
// Set up TDB callback.
|
||||
std::string shadowFile = expandPath (conf.get ("shadow.file"));
|
||||
if (shadowFile != "")
|
||||
|
@ -766,6 +766,7 @@ void runTaskCommand (
|
|||
else if (command == "completed") handleCompleted (tdb, task, conf);
|
||||
else if (command == "delete") handleDelete (tdb, task, conf);
|
||||
else if (command == "start") handleStart (tdb, task, conf);
|
||||
else if (command == "stop") handleStop (tdb, task, conf);
|
||||
else if (command == "done") handleDone (tdb, task, conf);
|
||||
else if (command == "undo") handleUndo (tdb, task, conf);
|
||||
else if (command == "export") handleExport (tdb, task, conf);
|
||||
|
@ -780,7 +781,6 @@ void runTaskCommand (
|
|||
else if (command == "oldest") handleReportOldest (tdb, task, conf);
|
||||
else if (command == "newest") handleReportNewest (tdb, task, conf);
|
||||
else if (command == "stats") handleReportStats (tdb, task, conf);
|
||||
else if (command == "usage") handleReportUsage (tdb, task, conf);
|
||||
else if (command == "" && task.getId ()) handleModify (tdb, task, conf);
|
||||
else if (command == "help") longUsage (conf);
|
||||
else shortUsage (conf);
|
||||
|
|
|
@ -79,6 +79,7 @@ void handleVersion (Config&);
|
|||
void handleExport (TDB&, T&, Config&);
|
||||
void handleDelete (TDB&, T&, Config&);
|
||||
void handleStart (TDB&, T&, Config&);
|
||||
void handleStop (TDB&, T&, Config&);
|
||||
void handleDone (TDB&, T&, Config&);
|
||||
void handleUndo (TDB&, T&, Config&);
|
||||
void handleModify (TDB&, T&, Config&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue