local mArguments = require('Module:Arguments')
local validFields =
local p =
local function err(msg) return string.format('Error: %s', msg)end
function p.main(frame) local args = mArguments.getArgs(frame) return p._main(args)end
function p._main(args) local input = args[1] local field = args[2] or args.field local showCityData = args.citydata
'error' then -- Check for missing data. local missingFields = for validField in pairs(validFields) do if not data[validField] then table.insert(missingFields, validField) end end if #missingFields > 0 then local msg = 'the ' .. mw.text.listToText(missingFields) .. ' fields are missing' return err(msg) else return end else -- Return the specified field, or the blank string if it is missing. local result = data[field] or if field
return p