nit [*options*] FILE [ARG]...
+nit [*options*] - [ARG]...
+
nit [*options*] -e COMMAND [ARG]...
# DESCRIPTION
$ nit examples/hello_world.nit
hello world
+If `-` is used instead of a module, then the program is read from the standard input.
+The whole program is read before its interpretation starts.
+
The Nit interpreter is usable and valid as a *shebang* interpreted directive.
It is however recommended to use with `/usr/bin/env` because the location of the executable is not standardized.
modelbuilder.load_rt_module(parent, amodule, "-")
mmodules = [amodule.mmodule.as(not null)]
+else if progname == "-" then
+ var content = stdin.read_all
+ var amodule = toolcontext.parse_module(content)
+ toolcontext.check_errors
+ modelbuilder.load_rt_module(null, amodule, "-")
+ mmodules = [amodule.mmodule.as(not null)]
else
mmodules = modelbuilder.parse([progname])
end