Scaffold - Control file(s)

Home

Control file uses a Rexscript syntax. Scaffold enhances Rexscript list of commands with specific ones described in this page.

When control files are passed as arguments to scaffold, they are parsed in order, line by line, and an internal representation of the projects is created. Once all control files were interpreted that internal representation is converted into real file system object.

List of commands:

Project
Starts a new project and makes it current
^\s*PROJECT\s+(.*)\s*$
Syntax:
PROJECT Extended Name Description goes here END
Arguments:
name
any string should do it, as it is converted for special purposes to a 'unix' name
description
anything except a line containing only the word END
A control file may generate any number of projects considering available memory. First line contains only the PROJECT keyword and the name. The text between this line and the END line is saved as project description.
Generator
Assigns a new generator to current project
^\s*GEN\s+(.*)\s*$
Syntax:
GEN basic GEN funky
Arguments:
name
any generator name that was previously made known to the scaffold program.
The generator is made current in that project. It is an error to use this command without any current project.
Some generators may be added multiple times to a project, others may throw an error. Check the documentation for individual generators for more information.
Template
Adds a template to current generator
^\s*TEMPL\s+(.*)\s*$
Syntax:
TEMPL ./my_c_template TEMPL ../all TEMPL ${TPATH}/t1
Arguments:
path
it must not be quoted. If relative, it is interpreted with respect to the control file.
It is an error to use this command without any current generator.
Overwrite
How to react if the file already exists
^\s*EXISTING\s+(?:(OVERWRITE)|(KEEP)|(BLEND))\s*$
Syntax:
EXISTING OVERWRITE EXISTING KEEP EXISTING BLEND
Arguments:
OVERWRITE
with this switch current generator will overwrite existing files
KEEP
with this switch current generator will not generate a new file
BLEND
the changes are mixed in with the content of the old file
It is an error to use this command without any current generator.

Also read about standard commands in Rexscript.

Related source code documentation:

Home