mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Documentation Update
- Added latest movie script.
This commit is contained in:
parent
579ebe6130
commit
cb952329d3
1 changed files with 40 additions and 0 deletions
40
doc/misc/script-hooks-2.txt
Normal file
40
doc/misc/script-hooks-2.txt
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
$ # Q: What is a formatting hook?
|
||||||
|
$ # A: Lua code that modifies task output at run time.
|
||||||
|
$
|
||||||
|
$ cat > hooks.lua
|
||||||
|
|
||||||
|
-- Make ID not show up
|
||||||
|
function id (name, value)
|
||||||
|
return "(shhh - it's a secret)", 0, nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Decorate the UUID
|
||||||
|
function uuid (name, value)
|
||||||
|
return '<<<' .. value .. '>>>', 0, nil
|
||||||
|
end
|
||||||
|
|
||||||
|
^D
|
||||||
|
|
||||||
|
$ # Q: What is a command hook?
|
||||||
|
$ # A: Lua code that changes the way commands work.
|
||||||
|
$
|
||||||
|
$ cat >> hooks.lua
|
||||||
|
|
||||||
|
-- Disable tags
|
||||||
|
function notags ()
|
||||||
|
return 1, 'Tags have been disabled'
|
||||||
|
end
|
||||||
|
|
||||||
|
^D
|
||||||
|
|
||||||
|
$
|
||||||
|
$ task config -- hook.format-id ~/demo/hooks.lua:id
|
||||||
|
$ task config -- hook.format-uuid ~/demo/hooks.lua:uuid
|
||||||
|
$ task config -- hook.pre-tag ~/demo/hooks.lua:notags
|
||||||
|
$ task list
|
||||||
|
$ task add Demonstrate formatting hooks
|
||||||
|
$ task 1 info
|
||||||
|
$ task config hooks on
|
||||||
|
$ task 1 info
|
||||||
|
$ task 1 +try_to_tag
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue