aboutsummaryrefslogtreecommitdiff
path: root/development/fpc/instantfpc.1
blob: d82eddf644a50a6e851459dd783619e8800932b2 (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
.TH instantfpc 1 "5 Sep 2021" "Free Pascal" "Instant pascal code interpreter"
.SH NAME
instantfpc \- The Free Pascal Interpreter.

.SH SYNOPSIS

.B instantfpc
[\fI\-h\fR] [\fI\-v\fR] [\fIcompiler options\fR] <\fIsource file\fR>
[\fIprogram arguments\fR]

.SH DESCRIPTION

.B instantfpc
is a Pascal code interpreter program. It compiles source and runs the
generated program. It allows Pascal source code to be treated like a script,
by placing
.B #!/usr/bin/env instantfpc
as the 'shebang' line at the top of the Pascal source file.

To avoid recompiling source when it hasn't changed,
.B instantfpc
keeps a cache (see
.B \-\-set\-cache
option). When
.B instantfpc
is run,
the source is compared with the cache. If the cached source is not valid, then source is
copied to the cache with the shebang line commented out, and the cached source is compiled.
If compilation fails, the \fBfpc\fR output is written to stdout and an exit code of 1
is returned.

If compilation is successful, the program is executed.
If \fIprogram arguments\fR were given, they are passed to the compiled program
when it is run.

If the compiler options contains \fB\-B\fR, the program is always recompiled.

If the environment variable
.B INSTANTFPCOPTIONS
is set, it is passed to the compiler as
the first argument(s).

.SH NOTE

.B instantfpc
is also installed as
.B ifpc
for compatibility with older versions of Free Pascal.

.SH USAGE

.B instantfpc
takes the following arguments:
.TP
.B \-h
Prints this help message and exit.
.TP
.B \-v
Prints version and exit.
.TP
.B \-\-get\-cache
Prints current cache directory and exit.
.TP
.B \-\-set\-cache=<path to cache>
Set the cache to be used. Otherwise uses environment variable
.B INSTANTFPCCACHE
if set, or
.B $HOME/.cache/instantfpc/
otherwise.
.TP
.B \-\-compiler=<path to compiler>
Normally \fBfpc\fR is searched in PATH and used as compiler.
.TP
.B \-\-skip\-run
Do not execute the program. Useful to test if script compiles.
.TP
.B \-B
Always recompile.

.SH SEE ALSO
.IP
.BR  fpc (1)