[luatex] Wildcard expansion by texlua on Windows
Joseph Wright
joseph at texdev.net
Thu Mar 7 19:22:09 CET 2024
Hello all,
I wonder if the handling of wildcard arguments by LuaTeX running as
texlua is documented anywhere, and if it's controllable.
With LuaTeX, irrespective of platform, arguments are passed 'as is' to
Lua, so if we have a test.tex file
\directlua{for _,v in ipairs(arg) do print(v) end}
\end
and run
luatex test.tex '*' -- macOS/Linux
luatex test.tex * -- Windows
we print "*". On the other hand, if we have test.lua file
for _,v in ipairs(arg) do print(v) end
and try
texlua test.lua '*' -- macOS/Linux
texlua test.lua * -- Windows
we get "*" on macOS/Linux and ... whatever is in the current directory
on Windows. If we use '*' there, that's *exactly* what gets shown - no
expansion, but also no loss of the ' chars (of course we can clean up).
I *think* that the only expansion is the same as e.g. dir would do -
only "*" and "?", and if there are no matches things are passed on as-is.
I can't see that this behaviour is documented anywhere, nor if it's at
all controllable.
Does anyone have any insight?
Joseph
More information about the luatex
mailing list.