Module:Variable arguments: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
m Undid revision 198236 by ArrowHead294 (talk)
Tag: Undo
Line 40: Line 40:


function p.lua_banner(frame)
function p.lua_banner(frame)
-- local args = mArguments.getArgs(frame, {
local args = mArguments.getArgs(frame, {
    -- parentOnly = true
    parentOnly = true
     -- })
     })
     local debugg = frame.args.debug_mode or args.debug_mode
     local debugg = frame.args.debug_mode or args.debug_mode
     local fmt = "* [[Module: %s]]\n"
     local fmt = "* [[Module: %s]]\n"
     local namespace = string.lower(frame:preprocess("{{NAMESPACE}}"))
     local namespace = string.lower(frame:preprocess("{{NAMESPACE}}"))
local result = ""
local result = ""
local i = 1
local i = 0
while true do
for k, v in pairs(args) do
local m = frame.args[i]
result = result .. (v == debugg and "" or string.format(fmt, frame:preprocess(string.format("{{ucfirst:%s}}", v))))
if m == nil then
break
end
result = result .. string.format(fmt, frame:preprocess(string.format("{{ucfirst:%s}}", m)))
i = i + 1
i = i + 1
end
end