From 80c8ceb0d4ae7eca729b0fc0f018b7a44a51f7b6 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 24 Jun 2018 18:20:11 -0700 Subject: Added manpage and fixed a bug that screwed up nomsu loading. --- nomsu.lua | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'nomsu.lua') diff --git a/nomsu.lua b/nomsu.lua index 6a0ea6d..70c30de 100644 --- a/nomsu.lua +++ b/nomsu.lua @@ -1,4 +1,4 @@ -if NOMSU_VERSION and NOMSU_LIB and NOMSU_SHARE then +if NOMSU_VERSION and NOMSU_PREFIX then local ver_bits do local _accum_0 = { } @@ -24,7 +24,7 @@ if NOMSU_VERSION and NOMSU_LIB and NOMSU_SHARE then local _len_0 = 1 for _index_0 = 1, #partial_vers do local v = partial_vers[_index_0] - _accum_0[_len_0] = tostring(NOMSU_SHARE) .. "/" .. tostring(v) .. "/?.lua" + _accum_0[_len_0] = tostring(NOMSU_PREFIX) .. "/share/nomsu/" .. tostring(v) .. "/?.lua" _len_0 = _len_0 + 1 end return _accum_0 @@ -34,7 +34,7 @@ if NOMSU_VERSION and NOMSU_LIB and NOMSU_SHARE then local _len_0 = 1 for _index_0 = 1, #partial_vers do local v = partial_vers[_index_0] - _accum_0[_len_0] = tostring(NOMSU_LIB) .. "/" .. tostring(v) .. "/?.so" + _accum_0[_len_0] = tostring(NOMSU_PREFIX) .. "/lib/nomsu/" .. tostring(v) .. "/?.so" _len_0 = _len_0 + 1 end return _accum_0 @@ -44,7 +44,7 @@ if NOMSU_VERSION and NOMSU_LIB and NOMSU_SHARE then local _len_0 = 1 for _index_0 = 1, #partial_vers do local v = partial_vers[_index_0] - _accum_0[_len_0] = tostring(NOMSU_SHARE) .. "/" .. tostring(v) + _accum_0[_len_0] = tostring(NOMSU_PREFIX) .. "/share/nomsu/" .. tostring(v) _len_0 = _len_0 + 1 end return _accum_0 @@ -293,23 +293,19 @@ run = function() if args.interactive then nomsu:run([[use "core" use "lib/consolecolor.nom" +action [quit, exit]: lua> "os.exit(0)" +action [help] + say ".." + This is the Nomsu v\(Nomsu version) interactive console. + You can type in Nomsu code here and hit 'enter' twice to run it. + To exit, type 'exit' or 'quit' and hit enter twice. + say ".." \(bright)\(underscore)Welcome to the Nomsu v\(Nomsu version) interactive console!\(reset color) - press \'enter\' twice to run a command + press 'enter' twice to run a command \("")]]) - local ready_to_quit = false - nomsu.A_quit = function() - ready_to_quit = true - return print("Goodbye!") - end - nomsu.A_exit = nomsu.A_quit - nomsu.A_help = function() - print("This is the Nomsu v" .. tostring(nomsu.A_Nomsu_version()) .. " interactive console.") - print("You can type in Nomsu code here and hit 'enter' twice to run it.") - return print("To exit, type 'exit' or 'quit' and hit enter twice") - end for repl_line = 1, math.huge do io.write(colored.bright(colored.yellow(">> "))) local buff = { } @@ -344,9 +340,6 @@ say ".." elseif not ok then Errhand.print_error(ret) end - if ready_to_quit then - break - end end end end -- cgit v1.2.3