Mercurial > prosody-hg
comparison util/prosodyctl/shell.lua @ 12864:9f9633364044
Merge 0.12->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 22 Jan 2023 15:43:44 +0100 |
| parents | 0f4feaf9ca64 3dfb87814d65 |
| children | d10957394a3c |
comparison
equal
deleted
inserted
replaced
| 12861:57e86d537ffe | 12864:9f9633364044 |
|---|---|
| 39 print(""); | 39 print(""); |
| 40 end | 40 end |
| 41 if have_readline then | 41 if have_readline then |
| 42 readline.save_history(); | 42 readline.save_history(); |
| 43 end | 43 end |
| 44 os.exit(); | 44 os.exit(0, true); |
| 45 end | 45 end |
| 46 send_line(client, line); | 46 send_line(client, line); |
| 47 end | 47 end |
| 48 | 48 |
| 49 local function printbanner() | 49 local function printbanner() |
| 116 repl(client); | 116 repl(client); |
| 117 end); | 117 end); |
| 118 | 118 |
| 119 client.events.add_handler("disconnected", function () | 119 client.events.add_handler("disconnected", function () |
| 120 print("--- session closed ---"); | 120 print("--- session closed ---"); |
| 121 os.exit(); | 121 os.exit(0, true); |
| 122 end); | 122 end); |
| 123 | 123 |
| 124 client.events.add_handler("received", function (stanza) | 124 client.events.add_handler("received", function (stanza) |
| 125 if stanza.name == "repl-output" or stanza.name == "repl-result" then | 125 if stanza.name == "repl-output" or stanza.name == "repl-result" then |
| 126 local result_prefix = stanza.attr.type == "error" and "!" or "|"; | 126 local result_prefix = stanza.attr.type == "error" and "!" or "|"; |
