1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

add -r option

This commit is contained in:
Kelly Brazil
2019-11-04 12:50:37 -08:00
parent 58a094a9b4
commit 4b7d7840d3
2 changed files with 4 additions and 4 deletions

View File

@ -45,8 +45,7 @@ The `jc` parsers can also be used as python modules. In this case the output wil
{'filename': 'echo', 'flags': '-rwxr-xr-x', 'links': '1', 'owner': 'root', 'group': 'wheel',
'size': '18128', 'date': 'May 3 22:26'}]
```
The goal is to keep the resulting JSON as flat and simple as possible. Also, keys have been converted to lowercase and special characters are replaced whenever possible. Numbers are kept as strings because, depending on context or the output options, numbers can sometimes turn into strings. (e.g 'human readable' options)
Two representations of the data are possible. The default representation uses a strict schema per parser and converts known numbers to int/float JSON values. Certain known values of None are converted to JSON Null, and, in some cases, additional semantic context fields are added. To access the raw, pre-processed JSON, use the `-r` or `raw=True` options.
## Installation
```
@ -83,7 +82,8 @@ jc PARSER [OPTIONS]
- `--w` enables the `w` parser
### Options
- `-p` specifies whether to pretty format the JSON output
- `-p` pretty format the JSON output
- `-r` raw output. Provides a more literal JSON output with all values as text and no additional sematic processing
## Examples
### arp

View File

@ -1,7 +1,7 @@
jc changelog
201911xx v1.5.1
- Add -r and raw=True options. By default, jc will now convert numbers, if possible and add other semantic information, while the raw output will keep all values as text and provide a more literal JSON output
- Add -r and raw=True options. By default, jc will now convert numbers, if possible, and add other semantic information, while the raw output will keep all values as text and provide a more literal JSON output
- Clean up helptext code
20191031 v1.1.1