Mercurial > prosody-hg
annotate plugins/muc/config_form_sections.lib.lua @ 14020:3c2bfa6a69df
prosodyctl shell: Move non-error result lines back to stdout, suppress with --quiet
We're figuring out how to keep usability and support machine-readability too.
We moved the status line (repl-result) to stderr so that when parsing
something like a table, it didn't get in the way. However sometimes the status
line is the thing we want to parse (e.g. invite creation). Parsing stderr
loses one of the purposes of stderr - to have an error-only channel to emit
stuff out of band (such as error messages).
So the new approach is:
- Status line on stdout, unless it's an error
- If you're parsing the output ("content") of the command, pass --quiet to
suppress the status line.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 30 Dec 2025 16:30:43 +0000 |
| parents | bb4dcc555091 |
| children |
| rev | line source |
|---|---|
| 9036 | 1 module:hook("muc-config-form", function(event) |
| 2 table.insert(event.form, { | |
| 3 type = "fixed"; | |
| 4 value = "Room information"; | |
| 5 }); | |
| 6 end, 100); | |
| 7 | |
| 8 module:hook("muc-config-form", function(event) | |
| 9 table.insert(event.form, { | |
| 10 type = "fixed"; | |
| 11 value = "Access to the room"; | |
| 12 }); | |
| 13 end, 90); | |
| 14 | |
| 15 module:hook("muc-config-form", function(event) | |
| 16 table.insert(event.form, { | |
| 17 type = "fixed"; | |
| 18 value = "Permissions in the room"; | |
| 19 }); | |
| 20 end, 80); | |
| 21 | |
| 22 module:hook("muc-config-form", function(event) | |
| 23 table.insert(event.form, { | |
| 24 type = "fixed"; | |
| 25 value = "Other options"; | |
| 26 }); | |
| 27 end, 70); |
