Software / code / prosody
Comparison
plugins/mod_console.lua @ 3452:2d1a5d8893c2
mod_console: Add host:* commands to help (thanks Zash)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sat, 14 Aug 2010 15:15:35 +0100 |
| parent | 3407:15f633285755 |
| child | 3540:bc139431830b |
comparison
equal
deleted
inserted
replaced
| 3451:6402a9defcdc | 3452:2d1a5d8893c2 |
|---|---|
| 175 return console_listener.onincoming(session.conn, res); | 175 return console_listener.onincoming(session.conn, res); |
| 176 end | 176 end |
| 177 session.print("Sorry, not sure what you want"); | 177 session.print("Sorry, not sure what you want"); |
| 178 end | 178 end |
| 179 | 179 |
| 180 | |
| 180 function commands.help(session, data) | 181 function commands.help(session, data) |
| 181 local print = session.print; | 182 local print = session.print; |
| 182 local section = data:match("^help (%w+)"); | 183 local section = data:match("^help (%w+)"); |
| 183 if not section then | 184 if not section then |
| 184 print [[Commands are divided into multiple sections. For help on a particular section, ]] | 185 print [[Commands are divided into multiple sections. For help on a particular section, ]] |
| 185 print [[type: help SECTION (for example, 'help c2s'). Sections are: ]] | 186 print [[type: help SECTION (for example, 'help c2s'). Sections are: ]] |
| 186 print [[]] | 187 print [[]] |
| 187 print [[c2s - Commands to manage local client-to-server sessions]] | 188 print [[c2s - Commands to manage local client-to-server sessions]] |
| 188 print [[s2s - Commands to manage sessions between this server and others]] | 189 print [[s2s - Commands to manage sessions between this server and others]] |
| 189 print [[module - Commands to load/reload/unload modules/plugins]] | 190 print [[module - Commands to load/reload/unload modules/plugins]] |
| 191 print [[host - Commands to activate, deactivate and list virtual hosts]] | |
| 190 print [[server - Uptime, version, shutting down, etc.]] | 192 print [[server - Uptime, version, shutting down, etc.]] |
| 191 print [[config - Reloading the configuration, etc.]] | 193 print [[config - Reloading the configuration, etc.]] |
| 192 print [[console - Help regarding the console itself]] | 194 print [[console - Help regarding the console itself]] |
| 193 elseif section == "c2s" then | 195 elseif section == "c2s" then |
| 194 print [[c2s:show(jid) - Show all client sessions with the specified JID (or all if no JID given)]] | 196 print [[c2s:show(jid) - Show all client sessions with the specified JID (or all if no JID given)]] |
| 201 elseif section == "module" then | 203 elseif section == "module" then |
| 202 print [[module:load(module, host) - Load the specified module on the specified host (or all hosts if none given)]] | 204 print [[module:load(module, host) - Load the specified module on the specified host (or all hosts if none given)]] |
| 203 print [[module:reload(module, host) - The same, but unloads and loads the module (saving state if the module supports it)]] | 205 print [[module:reload(module, host) - The same, but unloads and loads the module (saving state if the module supports it)]] |
| 204 print [[module:unload(module, host) - The same, but just unloads the module from memory]] | 206 print [[module:unload(module, host) - The same, but just unloads the module from memory]] |
| 205 print [[module:list(host) - List the modules loaded on the specified host]] | 207 print [[module:list(host) - List the modules loaded on the specified host]] |
| 208 elseif section == "host" then | |
| 209 print [[host:activate(hostname) - Activates the specified host]] | |
| 210 print [[host:deactivate(hostname) - Disconnects all clients on this host and deactivates]] | |
| 211 print [[host:list() - List the currently-activated hosts]] | |
| 206 elseif section == "server" then | 212 elseif section == "server" then |
| 207 print [[server:version() - Show the server's version number]] | 213 print [[server:version() - Show the server's version number]] |
| 208 print [[server:uptime() - Show how long the server has been running]] | 214 print [[server:uptime() - Show how long the server has been running]] |
| 209 print [[server:shutdown(reason) - Shut down the server, with an optional reason to be broadcast to all connections]] | 215 print [[server:shutdown(reason) - Shut down the server, with an optional reason to be broadcast to all connections]] |
| 210 elseif section == "config" then | 216 elseif section == "config" then |