From 7c461804ac6ae24d3026e803e7a0a04303a687c3 Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Mon, 5 Aug 2013 17:06:19 -0700 Subject: Adding the LuaLoad function to Dalos. --- src/Dalos-cli.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/Dalos-cli.cc') diff --git a/src/Dalos-cli.cc b/src/Dalos-cli.cc index acc7ea3..5c7cc8a 100644 --- a/src/Dalos-cli.cc +++ b/src/Dalos-cli.cc @@ -5,6 +5,7 @@ #include #include #include "BReadline.h" +#include "LuaLoad.h" using namespace Balau; @@ -36,6 +37,16 @@ static void showhelp(const char * binname, bool longhelp) { ); } +namespace { + +class DalosInit : public LuaExecCell { + virtual void run(Lua & L) override { + registerLuaLoad(L); + } +}; + +}; + void MainTask::Do() { std::list execs; bool interactive = false; @@ -69,6 +80,12 @@ void MainTask::Do() { } } + { + DalosInit dalosInit; + dalosInit.exec(luaMainTask); + dalosInit.throwError(); + } + while (optind < argc) { todo = true; IO file(new Input(argv[optind++])); -- cgit v1.2.3