nvme-cli : only print help text and return for nvme list -h option.
PATCH 1/1 nvme-cli : only print help text and return for nvme list -h option.
For " nvme list -h " don't print list after help text, only print help text and return.
Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at hgst.com>
--- nvme.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
nvme.c +6 -3
@@ -871,8 +871,8 @@ static int list(int argc, char **argv, struct command *cmd, struct plugin *plugichar path[264 ];struct dirent **devices;struct list_item *list_items; -unsigned int i, n, fd, ret; -int fmt; +unsigned int i, n, fd; +int fmt, ret;const char *desc ="Retrieve basic information for the given device" ;struct config {char *output_format;
@@ -887,7 +887,10 @@ static int list(int argc, char **argv, struct command *cmd, struct plugin *plugi {NULL} }; -argconfig_parse (argc, argv, desc, opts, &cfg,sizeof (cfg)); + ret =argconfig_parse (argc, argv, desc, opts, &cfg,sizeof (cfg)); +if (ret <0 ) +return ret; + fmt =validate_output_format (cfg.output_format);if (fmt !=JSON && fmt !=NORMAL )
Signature · 1 line
2.13.0
Sagi Grimberg
maintainerPATCH 1/1 nvme-cli : only print help text and return for nvme list -h option.
Looks good,
Reviewed-by Sagi Grimberg <sagi at grimberg.me>
Keith Busch
AppliedPATCH 1/1 nvme-cli : only print help text and return for nvme list -h option.
In reply to Chaitanya KulkarniThanks, applied.