| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
server-side, with argparse support
This allow a shell-command to provide a 'flags' field, which will automatically
cause the parameters to be fed through argparse.
The rationale is to make it easier for more complex commands to be invoked
from the command line (`prosodyctl shell foo bar ...`). Until now they were
limited to accepting a list of strings, and any complex argument processing
was non-standard and awkward to implement.
|
| |
|
| |
|
|
|
|
|
| |
This lets the server signal to the client that a special input is requested.
Currently we support the "password" type only.
|
|
|
|
|
|
|
| |
The code correctly inserted the ',' when there was already a "%q" in the
format string, but then the next argument would fail to match because it
inserted ", %q" instead of "%q". The code now matches both, ensuring the
generated code will not produce a syntax error with multiple arguments.
|
| |
|
|
|
|
|
| |
e.g.
prosodyctl shell muc room room@muc.example.com :set_name "This Room"
|
|
|
|
|
| |
E.g. when you do 'prosodyctl shell "s2s:show()"', this is the case that
triggers, and it was missing the @width argument, causing confusion.
|
|
|
|
| |
Fixes invalid attribute value: expected string, got number
|
|
|
|
|
|
| |
readline)
Feels like it should be faster.
|
|
|
|
|
| |
Kicks in if/when readline hasn't set $COLUMNS, e.g. when using the
`prosodyctl shell command like this` form.
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Part of #1600
|
| | |
|
| |
| |
| |
| | |
This lets it adjust the width of tables to the actual terminal width.
|
|/ |
|
|
|
|
| |
I miss my custom ANSI-colored greeting!
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Looked in the wrong table
Test procedure:
$ prosodyctl shell --quiet
Expect:
Prosody>
(No banner)
|
|
|
|
| |
Forgot in previous commit
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
adminstream for easier reuse
|
|
|
|
|
| |
Forgot it stops parsing --foo options at the first argument, so
subsequent commands need to parse their own options like this.
|
| |
|
| |
|
|
|
|
| |
E.g. `prosodyctl shell --socket /path/to/prosody.scok`
|
|
|
|
|
| |
So now if you set it to a custom value, both the client and the server
should use it.
|
|
|
|
|
|
| |
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!
|
|
|
|
|
|
| |
from final result
Fixes the client pausing for input after output from commands.
|
|
the prosodyctl admin shell
|