Module:User

local mUserLinks = require('Module:UserLinks') local mShared = require('Module:UserLinks/shared') local yesno = require('Module:Yesno')

local p = {}

local function validateArg(arg) arg = arg:match('^%s*(.-)%s*$') if arg ~= '' then return arg end end

function p.main(frame) local argKeys = { user = { 1,			'User', 'user' },		project = { 2,			'Project', 'project' },		lang = { 3,			'Lang', 'lang' }	}	local origArgs = frame:getParent.args local args = {} for argKey, t in pairs(argKeys) do		for i, origArgKey in ipairs(t) do			local value = validateArg(origArgs[origArgKey]) if value then args[argKey] = value break end end end local options = { span = false, separator = validateArg(origArgs.separator) or 'dot', isDemo = yesno(validateArg(origArgs.demo)) }	local codes = {'t', 'c'} local snippets = userLinks.getSnippets(args) local links = userLinks.getLinks(snippets) local success, result = pcall(mUserLinks.export, codes, links, options) if success then return result else return mShared.makeWikitextError(result, options.isDemo) end end

return p