mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 09:20:51 +00:00
Lunatic translator standalone: allow specifying list files.
All non-option positional arguments after an @ sign are taken as list files: hashes at the beginning of a line denote comments, truly empty lines are ignored, all other lines should contain one root CON file name. git-svn-id: https://svn.eduke32.com/eduke32@3539 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
1252e0d8e5
commit
aeeec9d2aa
1 changed files with 25 additions and 4 deletions
|
@ -3064,7 +3064,9 @@ end
|
||||||
|
|
||||||
if (string.dump) then
|
if (string.dump) then
|
||||||
-- running stand-alone
|
-- running stand-alone
|
||||||
|
local io = require("io")
|
||||||
|
|
||||||
|
-- Handle command-line arguments and remove those that have been processed.
|
||||||
local i = 1
|
local i = 1
|
||||||
while (arg[i]) do
|
while (arg[i]) do
|
||||||
if (handle_cmdline_arg(arg[i])) then
|
if (handle_cmdline_arg(arg[i])) then
|
||||||
|
@ -3074,9 +3076,7 @@ if (string.dump) then
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for argi=1,#arg do
|
local function compile(filename)
|
||||||
local filename = arg[argi]
|
|
||||||
|
|
||||||
reset_all()
|
reset_all()
|
||||||
|
|
||||||
g_directory = filename:match("(.*/)") or ""
|
g_directory = filename:match("(.*/)") or ""
|
||||||
|
@ -3094,7 +3094,6 @@ if (string.dump) then
|
||||||
|
|
||||||
if (not (g_cgopt["no"]==true)) then
|
if (not (g_cgopt["no"]==true)) then
|
||||||
local onlycheck = (g_cgopt["no"] == "onlycheck")
|
local onlycheck = (g_cgopt["no"] == "onlycheck")
|
||||||
local io = require("io")
|
|
||||||
local file = onlycheck and io.stdout or io.stderr
|
local file = onlycheck and io.stdout or io.stderr
|
||||||
|
|
||||||
local code, lineinfo = get_code_string(g_curcode, g_cgopt["debug-lineinfo"])
|
local code, lineinfo = get_code_string(g_curcode, g_cgopt["debug-lineinfo"])
|
||||||
|
@ -3115,6 +3114,28 @@ if (string.dump) then
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local havelists = false
|
||||||
|
|
||||||
|
for argi=1,#arg do
|
||||||
|
local filename = arg[argi]
|
||||||
|
|
||||||
|
if (filename=="@") then
|
||||||
|
-- Start file list processing from the next positional argument on.
|
||||||
|
havelists = true
|
||||||
|
elseif (havelists) then
|
||||||
|
printf("\n------ Handling list of CON files \"%s\"", filename)
|
||||||
|
for fn in io.lines(filename) do
|
||||||
|
-- A hash at the beginning of a line denotes a comment, an
|
||||||
|
-- empty line is skipped.
|
||||||
|
if (#fn>0 and not fn:match("^#")) then
|
||||||
|
compile(fn)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
compile(filename)
|
||||||
|
end
|
||||||
|
end
|
||||||
else
|
else
|
||||||
-- running from EDuke32
|
-- running from EDuke32
|
||||||
function compile(filenames)
|
function compile(filenames)
|
||||||
|
|
Loading…
Reference in a new issue