From: Martin George Date: Tue, 11 Feb 2025 16:07:24 +0000 (+0530) Subject: nvme: make -v output consistent with -H output for nvme get-property X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3d749249492cb9f63bb2ba900b34032ac343c311;p=users%2Fsagi%2Fnvme-cli.git nvme: make -v output consistent with -H output for nvme get-property 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 --- diff --git a/nvme.c b/nvme.c index 7e894704..41eb0a1c 100644 --- 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; }