Moduł:Drzewa link: Różnice pomiędzy wersjami
Z Nonsensopedii, polskiej encyklopedii humoru
M |
M (konkatenacja...) |
||
Linia 14: | Linia 14: | ||
local args = tools.getArgs(frame) |
local args = tools.getArgs(frame) |
||
if #args ~= 1 then |
if #args ~= 1 then |
||
return 'cat: nil (len ' |
return 'cat: nil (len ' .. #args .. ')' |
||
end |
end |
||
if args['1'] ~= nil then |
if args['1'] ~= nil then |
Wersja z 15:26, 30 lis 2020
local p = {}
local tools = require('Moduł:Narzędzia')
function p.linkCat(frame)
local expectedArgs = {
['główna']='główna',
['pliki']='pliki',
['nonnews']='nonnews',
['słownik']='cytaty',
['cytaty']='cytaty',
['poradniki']='poradniki',
['nonźródła']='nonźródła'
}
local args = tools.getArgs(frame)
if #args ~= 1 then
return 'cat: nil (len ' .. #args .. ')'
end
if args['1'] ~= nil then
lookup = args['1']
local cat = expectedArgs[lookup.split(':')[1].split(' – ')[0].lower()]
else
local cat = expectedArgs[args]
return 'cat ' + cat
end
end
return p