aboutsummaryrefslogtreecommitdiffstats
path: root/util/prosodyctl/shell.lua
Commit message (Collapse)AuthorAgeFilesLines
* util.prosodyctl.shell: Fix lint [luacheck]Kim Alvefur2023-12-091-1/+0
|
* util.prosodyctl.shell: Add :method syntax to make e.g. MUC commands easierKim Alvefur2023-12-091-2/+11
| | | | | e.g. prosodyctl shell muc room room@muc.example.com :set_name "This Room"
* util.prosodyctl.shell: Fix sending terminal width with single argumentKim Alvefur2023-04-071-1/+1
| | | | | E.g. when you do 'prosodyctl shell "s2s:show()"', this is the case that triggers, and it was missing the @width argument, causing confusion.
* util.prosodyctl.shell: Coerce terminal width to string (for util.stanza)Kim Alvefur2023-04-071-1/+1
| | | | Fixes invalid attribute value: expected string, got number
* util.human.io: Prefer using the $COLUMNS environment variable if set (by ↵Kim Alvefur2023-04-071-1/+1
| | | | | | readline) Feels like it should be faster.
* util.prosodyctl.shell: Use new term_width() for widthKim Alvefur2023-04-071-1/+2
| | | | | Kicks in if/when readline hasn't set $COLUMNS, e.g. when using the `prosodyctl shell command like this` form.
* util: Prefix module imports with prosody namespaceKim Alvefur2023-03-171-8/+8
|
* Merge 0.12->trunkKim Alvefur2023-01-221-2/+2
|\
| * util.prosodyctl.shell: Close state on exit to fix saving shell historyKim Alvefur2023-01-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures a last round of garbage collection and finalizers, which should include flushing the readline history file. Test procedure: ``` $ ./prosodyctl shell prosody> s2s:show() -- any command that is not the last in history ... output prosody> bye $ ./prosodyctl shell prosody> ^P ``` After this, the shell prompt should contain the last command from before the "bye". Before this patch, recent history is gone most of the time.
* | util: Remove various Lua 5.1 compatibility hacksKim Alvefur2022-07-021-2/+1
| | | | | | | | Part of #1600
* | util.prosodyctl.shell: Print errors in red to highlight themKim Alvefur2022-06-011-1/+8
| |
* | prosodyctl shell: Communicate width of terminal to mod_admin_shellKim Alvefur2022-05-301-1/+1
| | | | | | | | This lets it adjust the width of tables to the actual terminal width.
* | util.prosodyctl.shell: Support for receiving partial lines (no automatic \n)Matthew Wild2022-03-171-2/+6
|/
* util.prosodyctl.shell: Bring back banner set from config!Kim Alvefur2021-11-121-0/+2
| | | | I miss my custom ANSI-colored greeting!
* util.prosodyctl.shell: Allow setting custom prompt (admin_shell_prompt)Matthew Wild2021-11-111-4/+6
|
* util.prosodyctl.shell: Fix for different location of unpack in Lua 5.1Kim Alvefur2021-04-251-1/+2
|
* util.prosodyctl.shell: Fix for missing 'sep' arg to string.rep in Lua 5.1Kim Alvefur2021-04-251-1/+2
|
* util.prosodyctl.shell: Allow calling console commands with fewer shell quotesKim Alvefur2021-04-251-3/+2
| | | | | | | | E.g. `prosodyctl shell module reload disco example.com` becomes equivalent to `prosodyctl shell 'module:reload("disco", "example.com")`. Won't work for every possible command, but reduces the amount of shell quoting problems for most common commands.
* util.prosodyctl.shell: Allow passing a single command as argumentKim Alvefur2021-03-051-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | Test procedure: $ prosodyctl shell 'server:version()' Expect: > OK: hg:926d53af9a7a $ prosodyctl shell 'server:version()' 'hello' Expect: > Only one command is supported as argument $ prosodyctl shell 'lorem ipsum'; echo $? Expect: > Sorry, I couldn't understand that... console:1: syntax error near 'show' > 1 (error code) Thanks Menel for mentioning the feature
* util.prosodyctl.shell: Fix check for --quietKim Alvefur2021-03-051-1/+1
| | | | | | | | | | | | | Looked in the wrong table Test procedure: $ prosodyctl shell --quiet Expect: Prosody> (No banner)
* util.prosodyctl.shell: Collect extra return valuesKim Alvefur2020-06-171-1/+1
| | | | Forgot in previous commit
* util.prosodyctl.shell: Handle argument parsing errorsKim Alvefur2020-06-171-0/+9
| | | | | | While almost identical to the handling in util.startup, this seems more appropriate. It would also simplify if shell-specific options need to be handled in the future.
* util.prosodyctl.shell: Save readline historyKim Alvefur2020-06-021-0/+7
|
* util.prosodyctl.shell, util.adminstream: Move connection logic into ↵Matthew Wild2020-06-021-42/+8
| | | | adminstream for easier reuse
* util.prosodyctl.shell: Really fix --socket optionKim Alvefur2020-06-021-1/+3
| | | | | Forgot it stops parsing --foo options at the first argument, so subsequent commands need to parse their own options like this.
* util.prosodyctl.shell: Correct check for --socketKim Alvefur2020-06-021-1/+1
|
* prosodyctl+util.prosodyctl.*: Start breaking up the ever-growing prosodyctlMatthew Wild2020-06-021-1/+1
|
* util.prosodyctl.shell: Allow passing path to socket on command lineKim Alvefur2020-06-011-1/+1
| | | | E.g. `prosodyctl shell --socket /path/to/prosody.scok`
* util.prosodyctl.shell: Use same config option as module for socket pathKim Alvefur2020-06-011-1/+2
| | | | | So now if you set it to a custom value, both the client and the server should use it.
* util.prosodyctl.shell: Join socket path with current data directoryKim Alvefur2020-06-011-1/+3
| | | | | | Don't hardcode socket path as it happens to be in a source checkout. Hold on, it should use the same config option as the module!
* mod_admin_shell, mod_admin_telnet, util.prosodyctl.shell: Separate output ↵Matthew Wild2020-06-011-2/+4
| | | | | | from final result Fixes the client pausing for input after output from commands.
* prosodyctl, util.prosodyctl.shell: `prosodyctl shell` - a client to access ↵Matthew Wild2020-06-011-0/+125
the prosodyctl admin shell