]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: make -v output consistent with -H output for nvme get-property
authorMartin George <marting@netapp.com>
Tue, 11 Feb 2025 16:07:24 +0000 (21:37 +0530)
committerDaniel Wagner <wagi@monom.org>
Tue, 11 Feb 2025 16:42:11 +0000 (17:42 +0100)
Current -v verbose output of the nvme get-property command is a
no-op. So update it to make it consistent with the -H human-readable
output for this same command.

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

diff --git a/nvme.c b/nvme.c
index 7e89470483ba107a04566788cfb9e2b4ebd6d31c..41eb0a1c2eb3c5b8ddd25449ff4e19ef74eea4ab 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -6107,6 +6107,7 @@ static int get_property(int argc, char **argv, struct command *cmd, struct plugi
        _cleanup_nvme_dev_ struct nvme_dev *dev = NULL;
        __u64 value;
        int err;
+       nvme_print_flags_t flags = NORMAL;
 
        struct get_reg_config cfg = {
                .offset         = -1,
@@ -6127,9 +6128,12 @@ static int get_property(int argc, char **argv, struct command *cmd, struct plugi
                return -EINVAL;
        }
 
+       if (cfg.human_readable || argconfig_parse_seen(opts, "verbose"))
+               flags |= VERBOSE;
+
        err = nvme_get_single_property(dev_fd(dev), &cfg, &value);
        if (!err)
-               nvme_show_single_property(cfg.offset, value, cfg.human_readable);
+               nvme_show_single_property(cfg.offset, value, flags);
 
        return err;
 }