# HG changeset patch # User Matthew Wild # Date 1647512503 0 # Node ID bdb9577a48300993720955aedfc8b588219311af # Parent 1e34b910b73a38850f83036d159b4c367d0154d5 util.prosodyctl.shell: Support for receiving partial lines (no automatic \n) diff -r 1e34b910b73a -r bdb9577a4830 util/prosodyctl/shell.lua --- a/util/prosodyctl/shell.lua Thu Mar 17 10:20:23 2022 +0000 +++ b/util/prosodyctl/shell.lua Thu Mar 17 10:21:43 2022 +0000 @@ -89,11 +89,15 @@ local errors = 0; -- TODO This is weird, but works for now. client.events.add_handler("received", function(stanza) if stanza.name == "repl-output" or stanza.name == "repl-result" then + local dest = io.stdout; if stanza.attr.type == "error" then errors = errors + 1; - io.stderr:write(stanza:get_text(), "\n"); + dest = io.stderr; + end + if stanza.attr.eol == "0" then + dest:write(stanza:get_text()); else - print(stanza:get_text()); + dest:write(stanza:get_text(), "\n"); end end if stanza.name == "repl-result" then