Add /binder list

Amber Yust [04-13-14 - 05:02]
Add /binder list
Filename
Binder.lua
diff --git a/Binder.lua b/Binder.lua
index 878ef9f..464db99 100644
--- a/Binder.lua
+++ b/Binder.lua
@@ -128,16 +128,30 @@ function Binder.LoadBindings(bindSetName)
     print("Loaded ", Binder.bindCount, " bindings from bind set '", bindSetName, "'.")
 end

+function Binder.ListBindings()
+    local sets = {}
+    for setName in pairs(Binder.savedVariables.bindings) do
+        table.insert(sets, setName)
+    end
+    table.sort(sets)
+    print("Bind sets saved:")
+    for i,setName in ipairs(sets) do
+        print("- ", setName)
+    end
+end
+
 Binder.commands = {
     ["build"] = Binder.BuildBindingsTable,
     ["save"] = Binder.SaveBindings,
     ["load"] = Binder.LoadBindings,
+    ["list"] = Binder.ListBindings,
 }

 function Binder.SlashCommandHelp()
     print("Binder usage:")
     print("- /binder save <set name> (saves current keybindings)")
     print("- /binder load <set name> (loads specified keybindings)")
+    print("- /binder list (lists all saved bind sets)")
 end

 function Binder.SlashCommand(argtext)