From 1d75fbb58a1313ff402a987903ea4593eb0b91a2 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Mon, 28 Oct 2024 15:48:54 +1000 Subject: Minor tweaks. --- PolygLua.lua | 18 +++++++++--------- aataaj.lua | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/PolygLua.lua b/PolygLua.lua index 727e62c..20925b7 100755 --- a/PolygLua.lua +++ b/PolygLua.lua @@ -29,13 +29,13 @@ local log = function(v, t, s) io.flush() end --- This sets the global values, here and in the caller. -D = function(s) log(4, 'DEBUG ', s) end -I = function(s) log(3, 'INFO ', s) end -T = function(s) log(2, 'TIMEOUT ', s) end -W = function(s) log(1, 'WARNING ', s) end -E = function(s) log(0, 'ERROR ', s) end -C = function(s) log(-1, 'CRITICAL ', s) end +-- This sets the global values, here and in the caller. The "_G." part isn't needed, it's just there to make things more obvious to the reader. +_G.D = function(s) log(4, 'DEBUG ', s) end +_G.I = function(s) log(3, 'INFO ', s) end +_G.T = function(s) log(2, 'TIMEOUT ', s) end +_G.W = function(s) log(1, 'WARNING ', s) end +_G.E = function(s) log(0, 'ERROR ', s) end +_G.C = function(s) log(-1, 'CRITICAL ', s) end local optionsCommon = @@ -190,7 +190,7 @@ _.readCmd = function(cmd) end -__ = function(c) +_G.__ = function(c) local exe = {status = 0, lines = {}, logging = false, showing = false, cmd = '', command = c, isScript = false, script = ''} local n = 0 @@ -201,7 +201,7 @@ __ = function(c) exe.cmd = exe.cmd .. l .. ' ; ' end elseif 'string' == type(c) then - exe.isScript = ('#!' == c:sub(1,2)) and (n == 0) + exe.isScript = (n == 0) and ('#!' == c:sub(1,2)) for l in string.gmatch(c, '\n*([^\n]+)\n*') do if '' ~= l then if exe.isScript then diff --git a/aataaj.lua b/aataaj.lua index c01e4c3..d48ec94 100755 --- a/aataaj.lua +++ b/aataaj.lua @@ -175,7 +175,7 @@ end print('') io.flush() --- TODO - No idea why the fuck #Cards kept telling me 0. No number indexes? +-- #Cards kept telling me 0, no number indexes. local cnt = 0 for i,C in pairs(Cards) do cnt = cnt + 1 -- cgit v1.1