On Fri, 2018-06-29 at 16:51 -0700, Dan Williams wrote:
On Fri, Jun 29, 2018 at 4:39 PM, Ross Zwisler
<ross.zwisler(a)linux.intel.com> wrote:
> json_object_to_json_string_ext()'s second argument is a flags field
> which
> we always want to be JSON_C_TO_STRING_PRETTY. We were going to a
> lot of
> trouble for this, though. We had multiple variables set to be this
> one
> flag and util_display_json_array() took it as an argument, even
> though it
> never varied.
>
> Instead, just pass in the necessary flag when calling
> json_object_to_json_string_ext(), removing the local variables and
> the extra
> argument to util_display_json_array().
I was thinking of one day supporting a flag other than
JSON_C_TO_STRING_PRETTY and have it be controlled by the command
line.
However that never materialized, and we could always use an
environment variable to change the json format flag.
Or use jq to do some reformatting. e.g. <cmd> | jq -c should be the the
same as using the JSON_C_TO_STRING_PLAIN flag.
So,
Acked-by: Dan Williams <dan.j.williams(a)intel.com>