| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- --[[
- Debug console built-in commands
- @author : Eiyeron Fulmincendii
- cls : clears the console log
- help (aliases : ls) : displays the list of registered commands and display their help.
- ]]--
- Commands = {
- cls = {
- fun = function(console)
- console.logs = {}
- console.scroll_to_bottom = true
- end,
- help = "Clears the log"
- },
- help = {
- fun = function(console, fun)
- if fun then
- if console.command_helps[fun] then
- console:log(fun .. " " .. console.command_helps[fun])
- elseif console.commands[fun] then
- console:log(fun.." doesn't have help info.")
- else
- console:log("Command not found : "..fun)
- end
- return
- end
- local res = ""
- for k,v in pairs(console.commands) do
- res = res .. k .. " "
- end
- console:log(res)
- end,
- help = "[fun] : List commands or show help of a given command."
- },
- collectgarbage = {
- fun = function(console, opt, arg)
- collectgarbage(opt, arg)
- end,
- help = "[opt][, arg] : calls lua's collectgarbage'"
- }
- }
- -- Aliases
- Commands.ls = Commands.help
- return Commands
|