Here we present the Wafl command line interpreter syntax. This document is autogenerated. To get the current command line options please run:
clwafl -help
Command line interpreter program name may differ, depending on the
installation package. It may be clWafl
, clwafl
or wafl
.
Usage:
to run a program:
clwafl [<options>] <program file name> [<arguments>]
to run inline source code:
clwafl [<options>] -code "<source code>" [-args <arguments>]
to use some tools on a program or a library:
clwafl [<options>] <program or library file name>
where <options> is a space separated list including:
Program arguments:
-args <args> Specify Wafl program command line arguments.
Allowed only after the specified source code.
-dir:<app directory>
Specify the application directory.
Default is program file path, or '.'.
-workdir:<working directory>
Specify the working directory.
Default is program file path, or '.'.
-env:<env.var.name>=<env.var.value>
Define an environment variable.
-libdir:<lib directory>
Specify a library search directory.
-lib:<name>:<file>
Load Wafl library <file> as a parameterized library <name>.
-title:<a title>
Set console window title.
Database access:
-dbdriver:<database driver>
Select a database driver.
-db:<database alias>
Select a database alias.
-user:<database connection username>
Specify database user.
-pwd:<database connection password>
Specify database password.
Program checking:
-check Check if program or library is correct.
-checkdir check if all programs in curr.dir. are correct.
-checkdir:<dir>
Check if all programs in <dir> are correct.
-checkapp Check if all programs in curr.dir. and subdirs are correct.
-checkapp:<dir>
Check if all programs in <dir> and subdirs are correct.
Parallelization options:
-pd, -parallel-disable
Disable implicit parallelization (default).
-pa, -parallel-auto
Enable implicit parallelization, where it can be useful.
-ps, -parallel
Suggest the implicit parallelization, where it can be useful.
Similar to auto, but biased towards parallelization.
-pf, -parallel-force
Use parallelization wherever possible.
Runtime options:
-stack-std, -stdstack
Use standard stack.
-stack-ext, -extstack
Use extendable stack (default).
-stack-size:<n>
Initial stack size in MiB [0-1024].
For extendable stack this is the size of the first segment.
For standard stack this is the stack size.
The default is 0, which means OS defined.
-stack-blocksize:<n>
Single extendable stack block size in KiB [250-100000].
Only applicable for extendable stack. The default is 1024KiB.
-stack-limit:<n>
Total stack space limit for all threads combined in MiB.
Only applicable for extendable stack. Range is [0-100000].
The default is 0, which means 'unlimited'.
-stack-threadlimit:<n>
Maximum allowed stack size in MiB [0-100000].
Only applicable for extendable stack.
The default is 0, which means 'unlimited'.
Execution options:
-repeat:<n> Run the program <n> times.
-memory Output memory report.
-msgs Output compilation messages.
-timer Measure execution duration.
-wait Wait for a key after execution.
Debugging options:
-debug Use debug mode.
-dis-tailcalls
Disable tail calls optimization.
-nornd Run without random number generator initialization.
The same `random` numbers sequence is created each time,
except when parallel functions are used.
-parsersrc Output the source code generated from AST
-parserast Output the parser generated abstract syntax tree.
-buildersrc Output the builder generated 'meta' source code.
-builderaeg Output the builder generated abstract evaluation graph.
-short Output just few elements of the result collections.
Additional options:
-help Output this usage description.
-version Output version description.
-doc Generate documentation based on the program comments.
Works for programs and Wafl libraries.
-listlib List the system library contents.
Dynamic libraries are excluded.
-listlib:<w> List the system library elements with names containing <w>,
or the content of a dynamic library with filename <w>.
-verbose Output more details on -listlib, -version and -memory.
Wafl supports ANSI console control codes, often referred as ANSI escape sequences. The control sequences are printed to the console like a common text, but provide control of color, font style, cursor position and other options.
Console.wlib
Wafl library contains many predefined
sequences. It can be used to write more readable Wafl code. For example,
the following to code segments generate and output the same result:
"Regular\e[34mBlue\e[0mRegular"
"Regular"
+ con::colorFgBlue + "Blue" + con::resetColor
+ "Regular"
where {
con = library file 'Console.wlib';
}