Both are usable, I use a bit different system to handle my savedvariables.
Here is an example from pMinimap:
Code:
local defaults = {
one = true,
two = false,
three = 'test',
}
local function LoadDefaults()
pMinimapDB = pMinimapDB or {}
for k,v in next, defaults do
if(type(pMinimapDB[k]) == 'nil') then
pMinimapDB[k] = v
end
end
end
local function SlashHandler(str)
if(str == 'reset') then
pMinimapDB = nil
LoadDefaults()
print'savedvariables reset'
else
-- whatever
end
end
SLASH_PMINIMAP1 = '/pmm'
SlashCmdList.PMINIMAP = SlashHandler
Works quite well, it allows for defaults to be set, even when adding new entries.
I also put in a sample of my slashhandler