]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: make get-feature JSON output print everything
authorMartin George <marting@netapp.com>
Sun, 16 Feb 2025 15:58:31 +0000 (21:28 +0530)
committerDaniel Wagner <wagi@monom.org>
Mon, 17 Feb 2025 08:27:43 +0000 (09:27 +0100)
The nvme JSON outputs now print everything verbose. But this was
missed out for the get-feature command, so fix the same here.

Signed-off-by: Martin George <marting@netapp.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index 4f6cde852e0c557840381fb47149ff051bfbf0df..9d6d7184d4bb52347884ec691a0eb57ceb7ddece 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -4678,7 +4678,7 @@ static void get_feature_id_print(struct feat_cfg cfg, int err, __u32 result,
                        nvme_feature_show(cfg.feature_id, cfg.sel, result);
                        if (NVME_CHECK(cfg.sel, GET_FEATURES_SEL, SUPPORTED))
                                nvme_show_select_result(cfg.feature_id, result);
-                       else if (verbose)
+                       else if (verbose || !strcmp(nvme_cfg.output_format, "json"))
                                nvme_feature_show_fields(cfg.feature_id, result, buf);
                        else if (buf)
                                d(buf, cfg.data_len, 16, 1);