1 module runner
is aliced
;
12 // ////////////////////////////////////////////////////////////////////////// //
13 void main (string
[] args
) {
16 bool dumpFileNames
= false;
17 bool styleWarnings
= false;
18 bool doScripts
= true, doActions
= true;
19 bool measureTime
= false;
23 foreach (string fname
; args
[1..$]) {
29 if (fname
.length
== 0) continue;
30 if (fname
== "--") { nomore
= true; continue; }
31 if (fname
== "-d") { dumpFileNames
= true; continue; }
32 if (fname
== "-w") { styleWarnings
= true; continue; }
33 if (fname
== "-S") { doScripts
= false; continue; }
34 if (fname
== "-A") { doActions
= false; continue; }
35 if (fname
== "--time") { measureTime
= true; continue; }
36 if (fname
[0] == '@') {
37 if (fname
.length
< 2) assert(0, "gmk file?");
38 auto gmk
= new Gmk(fname
[1..$]);
39 funcs
~= gmkLoadScripts(gmk
, doScripts
:doScripts
, doActions
:doActions
, warnings
:false);
43 foreach (auto de; dirEntries(fname
, "*.gm[lx]", SpanMode
.breadth
)) {
45 foreach (auto pt
; pathSplitter(de.dirName
)) {
46 if (pt
.length
&& pt
[0] == '_') { doit
= false; break; }
49 if (dumpFileNames
) { import std
.stdio
; writeln("loading '", de.name
, "'..."); }
50 funcs
~= loadScript(de.name
, true);
54 if (dumpFileNames
) { import std
.stdio
; writeln("loading '", fname
, "'..."); }
55 funcs
~= loadScript(fname
, true);
60 if (funcs
.length
> 0) {
61 writeln(funcs
.length
, " function", (funcs
.length
> 1 ?
"s" : ""), " parsed");
62 foreach (auto fn
; funcs
) {
63 writeln("\n", fn
.toString
);
68 if (measureTime) writeln("executing...");
69 runScript("main", scargs);
71 auto dur = (MonoTime.currTime-stt).total!"msecs";
72 writeln("total execution took ", dur, " milliseconds");