summaryrefslogtreecommitdiff
path: root/src/Dalos-cli.cc
diff options
context:
space:
mode:
authorNicolas Noble <pixel@nobis-crew.org>2013-08-05 17:06:19 -0700
committerNicolas Noble <pixel@nobis-crew.org>2013-08-05 17:06:19 -0700
commit7c461804ac6ae24d3026e803e7a0a04303a687c3 (patch)
treebee94946b1caa71361755a4994ee0f8223931a9c /src/Dalos-cli.cc
parent88d9f26e322425c23a6f66716571f051a6c3e8a2 (diff)
Adding the LuaLoad function to Dalos.
Diffstat (limited to 'src/Dalos-cli.cc')
-rw-r--r--src/Dalos-cli.cc17
1 files changed, 17 insertions, 0 deletions
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 <Input.h>
#include <BStdIO.h>
#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<String> execs;
bool interactive = false;
@@ -69,6 +80,12 @@ void MainTask::Do() {
}
}
+ {
+ DalosInit dalosInit;
+ dalosInit.exec(luaMainTask);
+ dalosInit.throwError();
+ }
+
while (optind < argc) {
todo = true;
IO<Input> file(new Input(argv[optind++]));