mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Lua
- Tweaks to the Lua and extension API. Note that this is a documentation-only change, meaning the design is being honed. No support exists yet.
This commit is contained in:
parent
15030599fd
commit
15d25d4fdf
5 changed files with 10 additions and 13 deletions
|
@ -21,13 +21,6 @@ function usage ()
|
|||
return 'task random'
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: Valid Taskwarrior BNF, minimally defining a production rule that
|
||||
-- has the same name as the command itself
|
||||
function syntax ()
|
||||
return 'random ::= "random" ;'
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: 1 --> command does not modify data
|
||||
-- 0 --> command modifies data
|
||||
|
|
|
@ -18,6 +18,9 @@ end
|
|||
-- Arguments: The DOM reference to evaluate
|
||||
-- Returns: The value from the DOM lookup
|
||||
function lookup (name)
|
||||
return 1.23 -- Fake load average
|
||||
if name == 'system.load.average'
|
||||
then
|
||||
return 1.23 -- Fake load average
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ end
|
|||
|
||||
-- Arguments: None
|
||||
-- Returns: 0 --> success only
|
||||
function goodbye ()
|
||||
function execute ()
|
||||
print ('Goodbye.')
|
||||
end
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ end
|
|||
-- Arguments: None
|
||||
-- Returns: 1 --> failure
|
||||
-- 0 --> success
|
||||
function encourage ()
|
||||
function execute (uuid)
|
||||
-- Only provide encouragement if the verbosity settings allow it.
|
||||
verbosity = task_get ('rc.verbose')
|
||||
if string.find (verbosity, 'encourage') ~= nil
|
||||
|
|
|
@ -45,7 +45,8 @@ end
|
|||
-- Arguments: Raw data
|
||||
-- Returns: Formatted data
|
||||
-- Note: Shown here is a pass-through format, doing no formatting. This is
|
||||
-- the default behavior if the format function is not implemented.
|
||||
-- also the default behavior if the format function is not
|
||||
-- implemented.
|
||||
function format (value)
|
||||
return value
|
||||
end
|
||||
|
@ -53,8 +54,8 @@ end
|
|||
-- Arguments: Value
|
||||
-- Returns: Urgency Term
|
||||
-- Note: Should reference rc.urgency.<field>.coefficient
|
||||
function urgency (value)
|
||||
coefficient = task_get ('urgency.priority.coefficient')
|
||||
function urgency (uuid)
|
||||
coefficient = task_get ('rc.urgency.priority.coefficient')
|
||||
|
||||
-- TODO Urgency calculation here
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue