Extensions
- Created scripts/extensions/README to describe samples. - Created sample extension scripts of each type.
This commit is contained in:
31
scripts/extensions/program_hook.lua
Normal file
31
scripts/extensions/program_hook.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
-- Program Hook Extension.
|
||||
-- Implementing goodbye message.
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: An 8-element list of installation details. Only called once, on
|
||||
-- installation of the extension.
|
||||
function install ()
|
||||
return 'program', -- Type
|
||||
'goodbye', -- Name
|
||||
1.0, -- Version
|
||||
'Simply says goodbye', -- 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-exit'
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: 1, 'error' --> failure
|
||||
-- 0, nil --> success
|
||||
function goodbye ()
|
||||
print ('Goodbye.')
|
||||
return 0, nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user