From: Jean Privat Date: Fri, 3 Jun 2016 02:02:17 +0000 (-0400) Subject: niti: add `-` to read the standard input X-Git-Url: http://nitlanguage.org niti: add `-` to read the standard input Signed-off-by: Jean Privat --- diff --git a/src/nit.nit b/src/nit.nit index 9410b4d..a28bb6f 100644 --- a/src/nit.nit +++ b/src/nit.nit @@ -64,6 +64,12 @@ if opt_eval.value then 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