Module:Othergroups

local getArgs = require('Module:Arguments').getArgs local inArray = require('Module:TableTools').inArray local cfg = require('Module:Othergroups/config')

local p = {}

function p.main(frame) local args = getArgs(frame) return p._main(args) end

function p._main(args) local user = args[1] local exclude = args[2] or '' assert(user, "no user") userGroups = cfg.users[user] if userGroups == nil then return '' end ret = '' for k,v in ipairs(cfg.groups) do		if v ~= exclude and inArray(userGroups, v) then if #ret > 0 then ret = ret .. ', '			end ret = ret .. cfg.pages[v] end end return ret end

return p