pprintjson icon indicating copy to clipboard operation
pprintjson copied to clipboard

Feature request: Have a more consise format

Open olibre opened this issue 6 years ago • 1 comments

Thank you for you sweet JSON printer, I am using and enjoying it. 🤩 But, pprintjson often uses unnecessary room and I request an option to get a more concise display.

You may be inspired from file prettyjson.py described in that SO answer.

Example of a concise representation converted to an unnecessary verbose one:

$ pprintjson -c '
{
  "grid": {"port": "COM5"},
  "policy": {
    "movingaverage": 5,
    "hysteresis": 5,
    "fan1": {
      "name": "CPU",
      "signal": "cpu",
      "mode": "auto",
      "speed": 100,
      "curve": [[0, 75], [50, 75], [75, 100]]
    }
  }
}'
{
    "grid": {
        "port": "COM5"
    },
    "policy": {
        "movingaverage": 5,
        "hysteresis": 5,
        "fan1": {
            "name": "CPU",
            "signal": "cpu",
            "mode": "auto",
            "speed": 100,
            "curve": [
                [
                    0,
                    75
                ],
                [
                    50,
                    75
                ],
                [
                    75,
                    100
                ]
            ]
        }
    }
}

olibre avatar Oct 30 '19 14:10 olibre

@olibre Thanks for the feature request and links! I agree that offering some sort of option to enable concise output would be useful.

clarketm avatar Nov 01 '19 04:11 clarketm