util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rfkill: Set scols table name to make the json output valid
@ 2021-06-06 16:28 Nicolai Dagestad
  2021-06-07  8:44 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolai Dagestad @ 2021-06-06 16:28 UTC (permalink / raw)
  To: util-linux; +Cc: Nicolai Dagestad

Signed-off-by: Nicolai Dagestad <nicolai@dagestad.fr>

---

Hi, I just noticed that the json input for rfkill is invalid.
The array member of the top-level object, should be named but it wasn't.
I am not familiar with the codease so I just followed what I saw in lscpu,
if another name would be prefered I can change it.

 sys-utils/rfkill.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys-utils/rfkill.c b/sys-utils/rfkill.c
index 0e740e122..41b933415 100644
--- a/sys-utils/rfkill.c
+++ b/sys-utils/rfkill.c
@@ -465,6 +465,7 @@ static void rfkill_list_init(struct control *ctrl)
 		err(EXIT_FAILURE, _("failed to allocate output table"));
 
 	scols_table_enable_json(ctrl->tb, ctrl->json);
+	scols_table_set_name(ctrl->tb, "rfkill");
 	scols_table_enable_noheadings(ctrl->tb, ctrl->no_headings);
 	scols_table_enable_raw(ctrl->tb, ctrl->raw);
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rfkill: Set scols table name to make the json output valid
  2021-06-06 16:28 [PATCH] rfkill: Set scols table name to make the json output valid Nicolai Dagestad
@ 2021-06-07  8:44 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2021-06-07  8:44 UTC (permalink / raw)
  To: Nicolai Dagestad; +Cc: util-linux

On Sun, Jun 06, 2021 at 06:28:35PM +0200, Nicolai Dagestad wrote:
> Hi, I just noticed that the json input for rfkill is invalid.
> The array member of the top-level object, should be named but it wasn't.

I have also improve libsmartcols to not use unnamed array for the
top-level object. It seems better to use emptry string ("") than
nothing.

> I am not familiar with the codease so I just followed what I saw in lscpu,
> if another name would be prefered I can change it.

Changed to "rfkilldevices".

>  sys-utils/rfkill.c | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks!

 karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-07  8:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-06 16:28 [PATCH] rfkill: Set scols table name to make the json output valid Nicolai Dagestad
2021-06-07  8:44 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).