as it turns out --quiet breaks basically everything. never mind.

This commit is contained in:
Izaya 2017-05-24 23:03:14 +00:00
parent 51e5c68d9f
commit 9d57e69523

View File

@ -1,23 +1,9 @@
#!/usr/bin/env lua5.2 #!/usr/bin/env lua5.2
-- Initialization -- Initialization
log = "" log = ""
tA = {...}
for k,v in ipairs(tA) do
if type(v) == "string" then
if v:sub(1,10) == "--cfgfile=" then
cfgfile = v:sub(11)
elseif v:sub(1,10) == "--modfile=" then
modfile = v:sub(11)
elseif v == "--quiet" then
quiet = true
end
end
end
oldprint=print oldprint=print
function print(...) function print(...)
if not quiet then
oldprint(...) oldprint(...)
end
logline = "" logline = ""
if #{...} > 0 then if #{...} > 0 then
if #{...} > 1 then if #{...} > 1 then
@ -33,6 +19,16 @@ function print(...)
end end
print("Initializing and reading configuration") print("Initializing and reading configuration")
ts={} ts={}
tA = {...}
for k,v in ipairs(tA) do
if type(v) == "string" then
if v:sub(1,10) == "--cfgfile=" then
cfgfile = v:sub(11)
elseif v:sub(1,10) == "--modfile=" then
modfile = v:sub(11)
end
end
end
ss="" ss=""
cfgfile = cfgfile or "build.cfg" cfgfile = cfgfile or "build.cfg"
modfile = modfile or "modules.cfg" modfile = modfile or "modules.cfg"
@ -121,11 +117,7 @@ if cfg.test == "yes" then
print("Checking for errors...") print("Checking for errors...")
err={pcall(load,ss)} err={pcall(load,ss)}
if err[1] ~= true then if err[1] ~= true then
if quiet then
io.write(table.unpack(err),"\n")
else
print(table.unpack(err)) print(table.unpack(err))
end
else else
print("No errors detected by load()") print("No errors detected by load()")
end end