Module:Check for unknown parameters: Difference between revisions

include non-blank positional in the default, but excluded blank positional in the default
m>Frietjes
No edit summary
m>Frietjes
(include non-blank positional in the default, but excluded blank positional in the default)
Line 16: Line 16:
local pargs = frame:getParent().args
local pargs = frame:getParent().args
local ignoreblank = isnotempty(frame.args['ignoreblank'])
local ignoreblank = isnotempty(frame.args['ignoreblank'])
local checkpos = isnotempty(frame.args['checkpositional'])
local showblankpos = isnotempty(frame.args['showblankpositional'])
local knownargs = {}
local knownargs = {}
local unknown = frame.args['unknown'] or 'Found _VALUE_, '
local unknown = frame.args['unknown'] or 'Found _VALUE_, '
Line 73: Line 73:
addresult(k)
addresult(k)
end
end
elseif checkpos and
elseif type(k) == 'number' and  
type(k) == 'number' and  
knownargs[tostring(k)] == nil and
knownargs[tostring(k)] == nil and
( not ignoreblank or isnotempty(v) )
( showblankpos or isnotempty(v) )
then
then
addresult(k)
addresult(k)
Anonymous user