Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-cli : only print help text and return for nvme list -h option.
@ 2017-07-04 18:58 Chaitanya Kulkarni
  2017-07-05  6:35 ` Sagi Grimberg
  2017-07-05 16:22 ` Keith Busch
  0 siblings, 2 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2017-07-04 18:58 UTC (permalink / raw)


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(-)

diff --git a/nvme.c b/nvme.c
index 17d9d9e..5ac1117 100644
--- a/nvme.c
+++ b/nvme.c
@@ -871,8 +871,8 @@ static int list(int argc, char **argv, struct command *cmd, struct plugin *plugi
 	char 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)
-- 
2.13.0

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

* [PATCH] nvme-cli : only print help text and return for nvme list -h option.
  2017-07-04 18:58 [PATCH] nvme-cli : only print help text and return for nvme list -h option Chaitanya Kulkarni
@ 2017-07-05  6:35 ` Sagi Grimberg
  2017-07-05 16:22 ` Keith Busch
  1 sibling, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2017-07-05  6:35 UTC (permalink / raw)


Looks good,

Reviewed-by: Sagi Grimberg <sagi at grimberg.me>

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

* [PATCH] nvme-cli : only print help text and return for nvme list -h option.
  2017-07-04 18:58 [PATCH] nvme-cli : only print help text and return for nvme list -h option Chaitanya Kulkarni
  2017-07-05  6:35 ` Sagi Grimberg
@ 2017-07-05 16:22 ` Keith Busch
  1 sibling, 0 replies; 3+ messages in thread
From: Keith Busch @ 2017-07-05 16:22 UTC (permalink / raw)


Thanks, applied.

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

end of thread, other threads:[~2017-07-05 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-04 18:58 [PATCH] nvme-cli : only print help text and return for nvme list -h option Chaitanya Kulkarni
2017-07-05  6:35 ` Sagi Grimberg
2017-07-05 16:22 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox