Mercurial > prosody-hg
diff util/prosodyctl/shell.lua @ 13939:b1e7d3f571b1
prosodyctl shell: Output TSV when output is not a TTY
This is meant to make it easier to use in scripts.
CSV would have been nice but requires escaping of fields containing ",",
but this implementation simply ignores this and assumes fields will not
contain tabs.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 31 Aug 2025 00:47:25 +0200 |
| parents | c8e534b4f2e2 |
| children | 3326c8a29a86 |
line wrap: on
line diff
--- a/util/prosodyctl/shell.lua Sun Aug 31 00:41:59 2025 +0200 +++ b/util/prosodyctl/shell.lua Sun Aug 31 00:47:25 2025 +0200 @@ -30,7 +30,7 @@ end local function send_line(client, line, interactive) - client.send(st.stanza("repl-input", { width = tostring(term_width()), repl = interactive == false and "0" or "1" }):text(line)); + client.send(st.stanza("repl-input", { width = tostring(term_width(-1)), repl = interactive == false and "0" or "1" }):text(line)); end local function repl(client)
