Skip to content

Commit

Permalink
added new type json-spec to --output
Browse files Browse the repository at this point in the history
- implemented `--output json-spec` to sprint messages etc as spec, as provided by matrix-nio, without modifications
- see Issue #92
  • Loading branch information
8go committed Oct 8, 2022
1 parent a9c2d48 commit a2a3364
Show file tree
Hide file tree
Showing 8 changed files with 434 additions and 136 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ $ matrix-commander --content-repository-config # list config of content repo
$ matrix-commander --sync off -m Test -i image.svg # a faster send
$ matrix-commander --joined-rooms --output json | jq # get json output in JSON
$ matrix-commander --joined-rooms --output json-max | jq # full details
$ matrix-commander --joined-rooms --output json-spec | jq # as specification
$ matrix-commander --joined-rooms --output text # get human-readable output
$ # example of how to use stdin, how to pipe data into the program
$ echo "Some text" | matrix-commander # send a text msg via pipe
Expand Down Expand Up @@ -1587,11 +1588,11 @@ options:
skipped entirely before the 'send' which will improve
performance.
--output OUTPUT This option decides on how the output is presented.
Currently offered choices are: 'text', 'json' and
'json-max'. Provide one of these choices. The default
is 'text'. If you want to use the default, then there
is no need to use this option. If you have chosen
'text', the output will be formatted with the
Currently offered choices are: 'text', 'json', 'json-
max', and 'json-spec'. Provide one of these choices.
The default is 'text'. If you want to use the default,
then there is no need to use this option. If you have
chosen 'text', the output will be formatted with the
intention to be consumed by humans, i.e. readable
text. If you have chosen 'json', the output will be
formatted as JSON. The content of the JSON object
Expand All @@ -1600,9 +1601,11 @@ options:
a few data items for convenience. These convenient
data items are added to the data from matrix-nio. In
most cases the output will be processed by other
programs rather than read by humans. Option 'json-max'
is practically the same as '{OUTPUT_JSON}', but yet
another additional field has been added. The data item
programs rather than read by humans. Option 'json-
spec' is practically the same as 'json', but no
additional fields are added. Option 'json-max' is
practically the same as 'json', but yet another
additional field is added. The data item
'transport_response' which gives information on how
the data was obtained and transported is being added.
In most cases the output will be processed by other
Expand All @@ -1611,7 +1614,7 @@ options:
information program will continue to run. This is
useful for having version number in the log files.
You are running version 3.5.8 2022-10-07. Enjoy, star on Github and contribute
You are running version 3.5.9 2022-10-08. Enjoy, star on Github and contribute
by submitting a Pull Request.
```

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.8
3.5.9
Binary file removed dist/matrix-commander-3.5.8.tar.gz
Binary file not shown.
Binary file added dist/matrix-commander-3.5.9.tar.gz
Binary file not shown.
Binary file removed dist/matrix_commander-3.5.8-py3-none-any.whl
Binary file not shown.
Binary file added dist/matrix_commander-3.5.9-py3-none-any.whl
Binary file not shown.
545 changes: 420 additions & 125 deletions matrix_commander/matrix_commander.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://packaging.python.org/en/latest/tutorials/packaging-projects/
# https://setuptools.pypa.io/en/latest/userguide/
name = matrix-commander
version = 3.5.8
version = 3.5.9
author = 8go
description = A simple command-line Matrix client
long_description = file: PyPi-Instructions.md, README.md
Expand Down

0 comments on commit a2a3364

Please sign in to comment.