-- A trivial Lua slash command that greets the user. -- Drop this under .panto/extensions/ (project) or your user config's -- extensions/ dir, then type `/greet` or `/greet ` in the REPL. -- -- Slash-command handlers run synchronously and act by side effect (here, -- writing to stdout). `args` is the trimmed text after the command name; -- it is an empty string when none was given. The return value is ignored. panto.ext.register_command { name = "greet", description = "Print a greeting. Optional args name who to greet.", handler = function(args) local who = args ~= "" and args or "world" io.write("\n[greet] hello, " .. who .. "!\n") end, }