mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-26 15:47:19 +02:00
Enhancement - Hooks
- First fully functioning Lua hooks. Woohoo.
This commit is contained in:
parent
eeefc8a992
commit
69cae7731f
6 changed files with 252 additions and 72 deletions
|
@ -139,8 +139,6 @@ void Context::initialize ()
|
|||
int Context::run ()
|
||||
{
|
||||
int rc;
|
||||
Timer t ("Context::run");
|
||||
|
||||
std::string output;
|
||||
try
|
||||
{
|
||||
|
@ -193,8 +191,12 @@ int Context::run ()
|
|||
int Context::dispatch (std::string &out)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
Timer t ("Context::dispatch");
|
||||
|
||||
if (! hooks.trigger ("pre-dispatch"))
|
||||
return rc;
|
||||
|
||||
// TODO Just look at this thing. It cries out for a dispatch table.
|
||||
if (cmd.command == "projects") { rc = handleProjects (out); }
|
||||
else if (cmd.command == "tags") { rc = handleTags (out); }
|
||||
|
@ -245,6 +247,7 @@ int Context::dispatch (std::string &out)
|
|||
if (cmd.isWriteCommand () && !inShadow)
|
||||
shadow ();
|
||||
|
||||
hooks.trigger ("post-dispatch");
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue