diff --git a/CHANGELOG.md b/CHANGELOG.md index 571bd8b8..e287347e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. ## Unreleased +- Add `cli-main` function to the core, which invokes Janet's CLI interface. + This basically moves what was init.janet into boot.janet. - Improve flychecking, and fix flyching bugs introduced in 1.4.0. - Add `prin`, `eprint`, `eprintf` and `eprin` functions. The functions prefix with e print to `(dyn :err stderr)` diff --git a/src/mainclient/main.c b/src/mainclient/main.c index a04f2932..d665efc9 100644 --- a/src/mainclient/main.c +++ b/src/mainclient/main.c @@ -88,7 +88,9 @@ int main(int argc, char **argv) { Janet mainfun, out; janet_resolve(env, janet_csymbol("cli-main"), &mainfun); Janet mainargs[1] = { janet_wrap_array(args) }; - status = janet_pcall(janet_unwrap_function(mainfun), 1, mainargs, &out, NULL); + JanetFiber *fiber = janet_fiber(janet_unwrap_function(mainfun), 64, 1, mainargs); + fiber->env = env; + status = janet_continue(fiber, janet_wrap_nil(), &out); /* Deinitialize vm */ janet_deinit(); diff --git a/tools/amalg.janet b/tools/amalg.janet index c8cf35f9..b1806ab3 100644 --- a/tools/amalg.janet +++ b/tools/amalg.janet @@ -9,6 +9,7 @@ # Body (each path (tuple/slice (dyn :args) 1) + (print "\n/* " path " */\n") (print (slurp path))) # maybe will help