This repository has been archived on 2022-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
fuck-premake-old2/website/docs/newoption.md
KyrietS 393fc4bc04 Docs maintenance
- filled missing heading in tables (intentionally not everywhere)
- fixed link to symbols.md
- removed an accidentally added *.md extension from libX11.so
2021-09-15 22:36:11 +02:00

1.5 KiB

Registers a new command-line option. For more information, see Command Line Arguments.

newoption { description }

Parameters

description is a table describing the new option. It may contain the following fields:

Field Description
trigger What the user would type on the command line to select the option, e.g. "--name".
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.
default Optional. Sets the default for this option if not specified on the commandline.

Availability

Premake 4.0 and later.

Examples

Register a new option to select a rendering API for a 3D application.

newoption {
   trigger     = "gfxapi",
   value       = "API",
   description = "Choose a particular 3D API for rendering",
   default     = "opengl",
   allowed = {
      { "opengl",    "OpenGL" },
      { "direct3d",  "Direct3D (Windows only)" },
      { "software",  "Software Renderer" }
   }
}

See Also