Skip to content

Commit

Permalink
print script args
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Jul 20, 2024
1 parent 66a1989 commit 17dd377
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions bam.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@ Import("configure.lua")
Import("other/sdl/sdl.lua")
Import("other/freetype/freetype.lua")

function tprint (tbl, indent)
if not indent then indent = 0 end
local toprint = string.rep(" ", indent) .. "{\r\n"
indent = indent + 2
for k, v in pairs(tbl) do
toprint = toprint .. string.rep(" ", indent)
if (type(k) == "number") then
toprint = toprint .. "[" .. k .. "] = "
elseif (type(k) == "string") then
toprint = toprint .. k .. "= "
end
if (type(v) == "number") then
toprint = toprint .. v .. ",\r\n"
elseif (type(v) == "string") then
toprint = toprint .. "\"" .. v .. "\",\r\n"
elseif (type(v) == "table") then
toprint = toprint .. tprint(v, indent + 2) .. ",\r\n"
else
toprint = toprint .. "\"" .. tostring(v) .. "\",\r\n"
end
end
toprint = toprint .. string.rep(" ", indent-2) .. "}"
return toprint
end

print(tprint(ScriptArgs))

--- Setup Config -------
config = NewConfig()
config:Add(OptCCompiler("compiler"))
Expand Down

0 comments on commit 17dd377

Please sign in to comment.