From 2716cd2a769a11c01e93ba1a0d8f05db54c08657 Mon Sep 17 00:00:00 2001 From: lu fan Date: Thu, 16 Nov 2017 22:39:37 +0800 Subject: [PATCH] nvme_manage: retry the input command instead of just quitting. Change-Id: Ifd924bcee94bc4e36530b42a07afb5141b150cad Signed-off-by: lu fan Reviewed-on: https://review.gerrithub.io/387722 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris --- examples/nvme/nvme_manage/nvme_manage.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/nvme/nvme_manage/nvme_manage.c b/examples/nvme/nvme_manage/nvme_manage.c index 9c0e230710..5717467b9c 100644 --- a/examples/nvme/nvme_manage/nvme_manage.c +++ b/examples/nvme/nvme_manage/nvme_manage.c @@ -910,9 +910,10 @@ int main(int argc, char **argv) bool exit_flag = false; if (!scanf("%d", &cmd)) { - printf("Invalid Command\n"); + printf("Invalid Command: command must be number 1-8\n"); while (getchar() != '\n'); - return 0; + usage(); + continue; } switch (cmd) { case 1: