mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Hooks
- Applied patch from Johannes to add missing hooks. Signed-off-by: Paul Beckingham <paul@beckingham.net>
This commit is contained in:
parent
c640e05049
commit
aa891401e4
2 changed files with 6 additions and 0 deletions
|
@ -74,6 +74,7 @@ Hook& Hook::operator= (const Hook& other)
|
|||
Hooks::Hooks ()
|
||||
{
|
||||
validProgramEvents.push_back ("post-start");
|
||||
validProgramEvents.push_back ("post-commit");
|
||||
validProgramEvents.push_back ("pre-fatal-error");
|
||||
validProgramEvents.push_back ("pre-exit");
|
||||
validProgramEvents.push_back ("pre-command-line");
|
||||
|
@ -158,6 +159,8 @@ Hooks::Hooks ()
|
|||
validProgramEvents.push_back ("post-import-command");
|
||||
validProgramEvents.push_back ("pre-info-command");
|
||||
validProgramEvents.push_back ("post-info-command");
|
||||
validProgramEvents.push_back ("pre-modify-command");
|
||||
validProgramEvents.push_back ("post-modify-command");
|
||||
validProgramEvents.push_back ("pre-prepend-command");
|
||||
validProgramEvents.push_back ("post-prepend-command");
|
||||
validProgramEvents.push_back ("pre-projects-command");
|
||||
|
|
|
@ -1421,6 +1421,8 @@ int handleDone (std::string &outs)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int handleModify (std::string &outs)
|
||||
{
|
||||
context.hooks.trigger ("pre-modify-command");
|
||||
|
||||
int count = 0;
|
||||
std::stringstream out;
|
||||
|
||||
|
@ -1526,6 +1528,7 @@ int handleModify (std::string &outs)
|
|||
out << "Modified " << count << " task" << (count == 1 ? "." : "s.") << std::endl;
|
||||
|
||||
outs = out.str ();
|
||||
context.hooks.trigger ("post-modify-command");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue