-
Notifications
You must be signed in to change notification settings - Fork 20
newoption
mba105 edited this page Sep 24, 2014
·
3 revisions
Home > [Scripting Reference](Scripting Reference) > newoption
The newoption function registers a new command-line option argument. For more information, see [Command Line Arguments](Command Line Arguments).
#!lua
newoption (description)
description is a table describing the new option. It may contain the following fields:
trigger | The string identifier of the option; what the user would type on the command line. |
description | A short description of the option, to be displayed in the help text. |
value | Optional. If the option needs a value, provides a hint to the user what type of data is expected. |
allowed | Optional. A list of key-value pairs listing the allowed values for the option. |
[Command Line Arguments](Command Line Arguments)
Register a new option to select a rendering API for a 3D application.
#!lua
newoption {
trigger = "gfxapi",
value = "API",
description = "Choose a particular 3D API for rendering",
allowed = {
{ "opengl", "OpenGL" },
{ "direct3d", "Direct3D (Windows only)" },
{ "software", "Software Renderer" }
}
}