From 72753fa967b4d56e7e2e7619bfbe2428e20d8ada Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 2 Jun 2016 22:02:17 -0400 Subject: [PATCH] niti: add `-` to read the standard input Signed-off-by: Jean Privat --- src/nit.nit | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 1.7.9.5