Comparison

plugins/mod_admin_shell.lua @ 12304:8210c2a52e9c

mod_admin_shell: Use a table to show help sections Because tables make everything better and more readable!
author Kim Alvefur <zash@zash.se>
date Sun, 20 Feb 2022 00:24:18 +0100
parent 12293:145cb8305c67
child 12397:ddf02f2a3354
child 12505:604bb5b8362d
comparison
equal deleted inserted replaced
12303:fa79db7e0a4d 12304:8210c2a52e9c
210 local section = data:match("^help (%w+)"); 210 local section = data:match("^help (%w+)");
211 if not section then 211 if not section then
212 print [[Commands are divided into multiple sections. For help on a particular section, ]] 212 print [[Commands are divided into multiple sections. For help on a particular section, ]]
213 print [[type: help SECTION (for example, 'help c2s'). Sections are: ]] 213 print [[type: help SECTION (for example, 'help c2s'). Sections are: ]]
214 print [[]] 214 print [[]]
215 print [[c2s - Commands to manage local client-to-server sessions]] 215 local row = format_table({ { title = "Section"; width = 7 }; { title = "Description"; width = "100%" } })
216 print [[s2s - Commands to manage sessions between this server and others]] 216 print(row())
217 print [[http - Commands to inspect HTTP services]] -- XXX plural but there is only one so far 217 print(row { "c2s"; "Commands to manage local client-to-server sessions" })
218 print [[module - Commands to load/reload/unload modules/plugins]] 218 print(row { "s2s"; "Commands to manage sessions between this server and others" })
219 print [[host - Commands to activate, deactivate and list virtual hosts]] 219 print(row { "http"; "Commands to inspect HTTP services" }) -- XXX plural but there is only one so far
220 print [[user - Commands to create and delete users, and change their passwords]] 220 print(row { "module"; "Commands to load/reload/unload modules/plugins" })
221 print [[roles - Show information about user roles]] 221 print(row { "host"; "Commands to activate, deactivate and list virtual hosts" })
222 print [[muc - Commands to create, list and manage chat rooms]] 222 print(row { "user"; "Commands to create and delete users, and change their passwords" })
223 print [[stats - Commands to show internal statistics]] 223 print(row { "roles"; "Show information about user roles" })
224 print [[server - Uptime, version, shutting down, etc.]] 224 print(row { "muc"; "Commands to create, list and manage chat rooms" })
225 print [[port - Commands to manage ports the server is listening on]] 225 print(row { "stats"; "Commands to show internal statistics" })
226 print [[dns - Commands to manage and inspect the internal DNS resolver]] 226 print(row { "server"; "Uptime, version, shutting down, etc." })
227 print [[xmpp - Commands for sending XMPP stanzas]] 227 print(row { "port"; "Commands to manage ports the server is listening on" })
228 print [[debug - Commands for debugging the server]] 228 print(row { "dns"; "Commands to manage and inspect the internal DNS resolver" })
229 print [[config - Reloading the configuration, etc.]] 229 print(row { "xmpp"; "Commands for sending XMPP stanzas" })
230 print [[columns - Information about customizing session listings]] 230 print(row { "debug"; "Commands for debugging the server" })
231 print [[console - Help regarding the console itself]] 231 print(row { "config"; "Reloading the configuration, etc." })
232 print(row { "columns"; "Information about customizing session listings" })
233 print(row { "console"; "Help regarding the console itself" })
232 elseif section == "c2s" then 234 elseif section == "c2s" then
233 print [[c2s:show(jid, columns) - Show all client sessions with the specified JID (or all if no JID given)]] 235 print [[c2s:show(jid, columns) - Show all client sessions with the specified JID (or all if no JID given)]]
234 print [[c2s:show_tls(jid) - Show TLS cipher info for encrypted sessions]] 236 print [[c2s:show_tls(jid) - Show TLS cipher info for encrypted sessions]]
235 print [[c2s:count() - Count sessions without listing them]] 237 print [[c2s:count() - Count sessions without listing them]]
236 print [[c2s:close(jid) - Close all sessions for the specified JID]] 238 print [[c2s:close(jid) - Close all sessions for the specified JID]]