20.708
Bearbeitungen
(+ namespace()) |
(getArgs() auch ohne argslist) |
||
| Zeile 55: | Zeile 55: | ||
function p.getArgs(args, argslist) | function p.getArgs(args, argslist) | ||
local result = {} | local result, empty = {}, true | ||
if argslist ~= nil then -- mit argslist | |||
for _, a in ipairs(argslist) do | |||
local v = args[a] or "" | |||
if v ~= "" then | if v ~= "" then | ||
result[a] = v | |||
empty = false | |||
end | |||
end | |||
else -- ohne argslist | |||
for a, v in pairs(args) do | |||
if v ~= nil and v ~= "" then | |||
result[a] = v | |||
empty = false | |||
end | |||
end | end | ||
end | end | ||