Linux-NVDIMM Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Williams, Dan J" <dan.j.williams@intel.com>,
	"ross.zwisler@linux.intel.com" <ross.zwisler@linux.intel.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl PATCH 1/3] ndctl: simplify JSON print flag handling
Date: Fri, 29 Jun 2018 23:59:19 +0000	[thread overview]
Message-ID: <1530316757.7574.19.camel@intel.com> (raw)
In-Reply-To: <CAPcyv4h3FxqAFtN_JtODtqa2U_CMxnVePK_h+4DURNocVqvC2w@mail.gmail.com>


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@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@intel.com>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

      reply	other threads:[~2018-06-29 23:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29 23:39 [ndctl PATCH 1/3] ndctl: simplify JSON print flag handling Ross Zwisler
2018-06-29 23:39 ` [ndctl PATCH 2/3] ndctl/list.c: simplify flags handling Ross Zwisler
2018-06-29 23:57   ` Dan Williams
2018-06-30  0:29     ` Ross Zwisler
2018-06-30  0:42       ` Dan Williams
2018-06-29 23:39 ` [ndctl PATCH 3/3] ndctl list: always output array without --human Ross Zwisler
2018-06-29 23:51 ` [ndctl PATCH 1/3] ndctl: simplify JSON print flag handling Dan Williams
2018-06-29 23:59   ` Verma, Vishal L [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1530316757.7574.19.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=ross.zwisler@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox