The template processor begins by processing the command line for template options. The options are specified via option=value arguments. In simple cases, such as when using only one template, the ordering of the command line arguments should not affect the output. However, when multiple templates are used symoultaneously for a template merge, the order matters. The order is as follows.

  1. global options can be specified at any point, but are recommended to be placed at the beginning for consistency.
  2. template options that should be applied to all templates are specified before any template is listed.
  3. template options that should be applied to an individual template only should be specified after listing the template (and before the next template is listed).
Tip

The template can be specified without explicitly using template\=. E.g., you can run python file_template.py sandbox instead of python file_template.py template=sandbox

The following examples illustrates this structure:

Table 1.4. Command line structure examples:

invocation

global options

options for all templates

first template

second template

python file_template.py

sandbox

python file_template.py

destination=/boost_sandbox

sandbox library=boostified_library vc8ide=y ignore=$template_library$/boost

/old_library/include/old_library into=boostified_library/boost/boostified_library

Some template options, such as ignore and fignore, can be specified multiple times for the same template.

After processing the command line, or prompting the user if necessary, the template processor will initialize each template object (which processes the template and can be used by any in-template template script to customize the behavior of the template) and the global template options.

The template processor will then examine the template tree.