From 3654ddc269a366d786cdef2a799a8b95025f1c8a Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Mon, 6 Nov 2017 09:30:54 +0530 Subject: cli: gluster help changes gluster cli help now shows only the top level help commands. gluster help will now show help commands for . Change-Id: I263f53a0870d80ef4cfaad455fdaa47e2ac4423b BUG: 1509786 > BUG: 1474768 > Signed-off-by: N Balachandran (cherry picked from commit 89dc54f50c9f800ca4446ea8fe736e4860588845) Signed-off-by: N Balachandran --- cli/src/cli-cmd-parser.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'cli/src/cli-cmd-parser.c') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index c8ed3673847..6eee72e2d16 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -1075,8 +1075,13 @@ cli_cmd_quota_parse (const char **words, int wordcount, dict_t **options) goto out; } - if (wordcount < 4) + if (wordcount < 4) { + + if ((wordcount == 3) && !(strcmp (words[2], "help"))) { + ret = 1; + } goto out; + } volname = (char *)words[2]; if (!volname) { @@ -5470,15 +5475,22 @@ cli_cmd_bitrot_parse (const char **words, int wordcount, dict_t **options) GF_ASSERT (words); GF_ASSERT (options); - dict = dict_new (); - if (!dict) - goto out; + + /* Hack to print out bitrot help properly */ + if ((wordcount == 3) && !(strcmp (words[2], "help"))) { + ret = 1; + return ret; + } if (wordcount < 4 || wordcount > 5) { gf_log ("cli", GF_LOG_ERROR, "Invalid syntax"); goto out; } + dict = dict_new (); + if (!dict) + goto out; + volname = (char *)words[2]; if (!volname) { ret = -1; -- cgit