-
Notifications
You must be signed in to change notification settings - Fork 20
newaction
mba105 edited this page Sep 24, 2014
·
3 revisions
Home > [Scripting Reference](Scripting Reference) > newaction
The newaction function registers a new command-line action argument. For more information, see [Command Line Arguments](Command Line Arguments).
#!lua
newaction (description)
description is a table describing the new action. It may contain the following fields:
trigger | The string identifier of the action; what the user would type on the command line. |
description | A short description of the action, to be displayed in the help text. |
execute | A function to be executed when the action is fired. |
[Command Line Arguments](Command Line Arguments)
Register a new action to install the software project.
#!lua
newaction {
trigger = "install",
description = "Install the software",
execute = function ()
os.copyfile("bin/debug/myprogram", "/usr/local/bin/myprogram")
end
}