mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Extensions
- Created scripts/extensions/README to describe samples. - Created sample extension scripts of each type.
This commit is contained in:
parent
bac4610580
commit
60a5d271f4
10 changed files with 335 additions and 55 deletions
36
scripts/extensions/task_hook.lua
Normal file
36
scripts/extensions/task_hook.lua
Normal file
|
@ -0,0 +1,36 @@
|
|||
-- Task Hook Extension.
|
||||
-- Implementing encouragement message.
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: An 8-element list of installation details. Only called once, on
|
||||
-- installation of the extension.
|
||||
function install ()
|
||||
return 'task', -- Type
|
||||
'encourage', -- Name
|
||||
1.0, -- Version
|
||||
'Positive feedback', -- Description
|
||||
'Paul Beckingham', -- Author
|
||||
'paul@beckingham.net', -- Contact
|
||||
'GPLv2', -- License
|
||||
'© 2011, Göteborg Bit Factory' -- Copyright
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: String identifying valid program hook
|
||||
function hook ()
|
||||
return 'on-task-complete'
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: 1, 'error' --> failure
|
||||
-- 0, nil --> success
|
||||
function encourage ()
|
||||
-- Only provide encouragement if the verbosity settings allow it.
|
||||
verbosity = task_get ('rc.verbose')
|
||||
if string.find (verbosity, 'encourage') ~= nil
|
||||
then
|
||||
print ('Good work.')
|
||||
end
|
||||
return 0, nil
|
||||
end
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue