Skip to content
mba105 edited this page Sep 24, 2014 · 3 revisions

Home > [Scripting Reference](Scripting Reference) > newaction


newaction

The newaction function registers a new command-line action argument. For more information, see [Command Line Arguments](Command Line Arguments).

#!lua
newaction (description)

Parameters

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.

See Also

[Command Line Arguments](Command Line Arguments)

Examples

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
}
Clone this wiki locally