Kim Alvefur
cd641dca64
util.prosodyctl.shell: Allow passing a single command as argument
...
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
5 years ago
Kim Alvefur
71cb57df51
util.prosodyctl.shell: Fix check for --quiet
...
Looked in the wrong table
Test procedure:
$ prosodyctl shell --quiet
Expect:
Prosody>
(No banner)
5 years ago
Kim Alvefur
3077309ce7
util.prosodyctl.shell: Collect extra return values
...
Forgot in previous commit
6 years ago
Kim Alvefur
e2685cad2f
util.prosodyctl.shell: Handle argument parsing errors
...
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.
6 years ago
Kim Alvefur
6264bd48c1
util.prosodyctl.shell: Save readline history
6 years ago
Matthew Wild
78a8bfc31d
util.prosodyctl.shell, util.adminstream: Move connection logic into adminstream for easier reuse
6 years ago
Kim Alvefur
425c9cb979
util.prosodyctl.shell: Really fix --socket option
...
Forgot it stops parsing --foo options at the first argument, so
subsequent commands need to parse their own options like this.
6 years ago
Kim Alvefur
0fea1b599e
util.prosodyctl.shell: Correct check for --socket
6 years ago
Matthew Wild
46022b0988
prosodyctl+util.prosodyctl.*: Start breaking up the ever-growing prosodyctl
6 years ago
Kim Alvefur
f4436b0ad8
util.prosodyctl.shell: Allow passing path to socket on command line
...
E.g. `prosodyctl shell --socket /path/to/prosody.scok`
6 years ago
Kim Alvefur
05f5f794bf
util.prosodyctl.shell: Use same config option as module for socket path
...
So now if you set it to a custom value, both the client and the server
should use it.
6 years ago
Kim Alvefur
aa24574b89
util.prosodyctl.shell: Join socket path with current data directory
...
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!
6 years ago
Matthew Wild
e703759258
mod_admin_shell, mod_admin_telnet, util.prosodyctl.shell: Separate output from final result
...
Fixes the client pausing for input after output from commands.
6 years ago
Matthew Wild
a355440c01
prosodyctl, util.prosodyctl.shell: `prosodyctl shell` - a client to access the prosodyctl admin shell
6 years ago