-
Notifications
You must be signed in to change notification settings - Fork 2
/
USAGE.txt
68 lines (47 loc) · 2.65 KB
/
USAGE.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FORGE
This is a HyperTalk interpreter that compiles scripts into a bytecode and then
executes the "startup" handler in them. The command line tool has the following
syntax:
forge [options] [--folder] <inputfile> [arguments]
Where inputfile is the path to a UTF8-encoded text file that contains a valid
HyperTalk script. Currently, the following options are supported:
--webpage Run in "webpage" mode, which means text in the file will
just be printed out, and actual script commands have
to be within <?hc and ?> delimiters, like PHP or VBScript
let you do it.
--folder The <inputfile> given is a folder. Process all the scripts
inside it. This is useful with the --webpage option to
turn an entire folder full of scripts into a static site.
--message <messageName> The message to send. I.e. the name of the first handler
to call. If this is not specified, the handler named
"startUp" will be called. In web mode, no handler will be
called by default and any text or commands at
the script's top level will be run instead.
--debug <host> Try to connect to a remote debugger on startup on server
<host>:13762. This will also set a breakpoint on the
startUp handler's first instruction so you can step
through the code if you desire. It is OK to pass
127.0.0.1 here to connect to a debugger on your local
machine, like ForgeDebugger.
--dontrun Compile the code, but do not actually execute it (this
also means the debugger won't have anything to debug).
--printtokens Dump information on all tokens in the script to stdout.
--printparsetree Dump a text description of the parse tree matching the
given script to stdout.
--printinstructions Dump all bytecode instructions as a sort of pseudo-
source-code to stdout.
--printindented Pretty-print the script, indenting lines according to
Forge's interpretation of the script and on/end lines.
--printresult Prints "Result: " followed by the value returned by the
first handler, in quotes.
--dont-optimize Do not perform optimizations on the script, run it as
written.
--verbose Dump some additional headings and status messages to
stdout.
arguments Any additional arguments following the file name will be
passed on to the script's first handler as parameters.
A script may start with the usual Unix "shebang" sequence "#!", which Forge
will ignore. It is recommended that Forge scripts use the filename suffix ".hc"
(or ".sh" if you really must) and use the standard shebang "#!/usr/bin/env forge"
instead of making assumptions about where in the user's PATH Forge has been
installed.