diff options
| author | Marc Tiehuis <marctiehuis@gmail.com> | 2018-03-31 19:04:01 +1300 |
|---|---|---|
| committer | Marc Tiehuis <marctiehuis@gmail.com> | 2018-04-01 17:03:06 +1200 |
| commit | 2e5115b0687ee9b7078dbf70da7d7070a7c80399 (patch) | |
| tree | 23f3acc2db17931b0bbb2ef4837de7b06dcfcc25 /std | |
| parent | 67f11190d10caac1d08b76d60ec28eb2f5173946 (diff) | |
| download | zig-2e5115b0687ee9b7078dbf70da7d7070a7c80399.tar.gz zig-2e5115b0687ee9b7078dbf70da7d7070a7c80399.zip | |
Add run compiler command
'zig run file.zig' builds a file and stores the artifacts in the global
cache. On successful compilation the binary is executed.
'zig run file.zig -- a b c' does the same, but passes the arguments a,
b and c as runtime arguments to the program. Everything after an '--' are
treated as runtime arguments.
On a posix system, a shebang can be used to run a zig file directly. An
example shebang would be '#!/usr/bin/zig run'. You may not be able pass
extra compile arguments currently as part of the shebang. Linux for example
treats all arguments after the first as a single argument which will result
in an 'invalid command'.
Currently there is no customisability for the cache path as a compile
argument. For a posix system you can use `TMPDIR=. zig run file.zig` to
override, in this case using the current directory for the run cache.
The input file is always recompiled, even if it has changed. This is
intended to be cached but further discussion/thought needs to go into
this.
Closes #466.
Diffstat (limited to 'std')
0 files changed, 0 insertions, 0 deletions
