Message289725
Probably the best thing we could do here is to mirror the options available in similar tools, such as jq: https://stedolan.github.io/jq/manual/#Invokingjq
The relevant options here would be:
--indent
--tab
--compact-output
--sort-keys
The default indent in jq is 2, which I tend to prefer these days, but maybe 4 is still appropriate given PEP 8:
$ echo '[{}, {"a": "b"}, 2, 3, 4]' | jq
[
{},
{
"a": "b"
},
2,
3,
4
]
This is how jq interprets --compact-output:
$ echo '[{}, {"a": "b"}, 2, 3, 4]' | jq --compact-output
[{},{"a":"b"},2,3,4]
I do not think that it's worth having the command-line tool cater to people that want to indent in other ways (e.g. using a string that isn't all spaces or a single tab). |
|
Date |
User |
Action |
Args |
2017-03-16 18:21:20 | bob.ippolito | set | recipients:
+ bob.ippolito, rhettinger, ezio.melotti, r.david.murray, methane, serhiy.storchaka, dhimmel |
2017-03-16 18:21:20 | bob.ippolito | set | messageid: <1489688480.13.0.82291460542.issue29636@psf.upfronthosting.co.za> |
2017-03-16 18:21:20 | bob.ippolito | link | issue29636 messages |
2017-03-16 18:21:20 | bob.ippolito | create | |
|