mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Enhancement - Hooks
- Implemented pre-debug, post-debug. - Implemented pre-header, post-header. - Implemented pre-output, post-output. - Implemented pre-footnote, post-footnote. - Implemented pre-gc, post-gc. - Implemented pre-undo, post-undo. - Implemented pre-add-command, post-add-command.
This commit is contained in:
parent
8540cab0a6
commit
1cd6d4c7e7
4 changed files with 26 additions and 3 deletions
|
@ -159,29 +159,37 @@ int Context::run ()
|
|||
}
|
||||
|
||||
// Dump all debug messages.
|
||||
hooks.trigger ("pre-debug");
|
||||
if (config.getBoolean ("debug"))
|
||||
foreach (d, debugMessages)
|
||||
if (config.getBoolean ("color") || config.getBoolean ("_forcecolor"))
|
||||
std::cout << colorizeDebug (*d) << std::endl;
|
||||
else
|
||||
std::cout << *d << std::endl;
|
||||
hooks.trigger ("post-debug");
|
||||
|
||||
// Dump all headers.
|
||||
hooks.trigger ("pre-header");
|
||||
foreach (h, headers)
|
||||
if (config.getBoolean ("color") || config.getBoolean ("_forcecolor"))
|
||||
std::cout << colorizeHeader (*h) << std::endl;
|
||||
else
|
||||
std::cout << *h << std::endl;
|
||||
hooks.trigger ("post-header");
|
||||
|
||||
// Dump the report output.
|
||||
hooks.trigger ("pre-output");
|
||||
std::cout << output;
|
||||
hooks.trigger ("post-output");
|
||||
|
||||
// Dump all footnotes.
|
||||
hooks.trigger ("pre-footnote");
|
||||
foreach (f, footnotes)
|
||||
if (config.getBoolean ("color") || config.getBoolean ("_forcecolor"))
|
||||
std::cout << colorizeFootnote (*f) << std::endl;
|
||||
else
|
||||
std::cout << *f << std::endl;
|
||||
hooks.trigger ("post-footnote");
|
||||
|
||||
hooks.trigger ("pre-exit");
|
||||
return rc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue