diff options
author | N Balachandran <nbalacha@redhat.com> | 2017-08-01 16:58:27 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2017-11-02 12:54:06 +0000 |
commit | 89dc54f50c9f800ca4446ea8fe736e4860588845 (patch) | |
tree | 3ab8f0d02c5b7cec5d113b60826a7bdffcdc47c7 /cli/src/cli-cmd-parser.c | |
parent | f9eedcad0127705c685e8b192726e46b170f00d1 (diff) |
cli: gluster help changes
gluster cli help now shows only the top level
help commands. gluster <component> help will now show
help commands for <component>.
Change-Id: I263f53a0870d80ef4cfaad455fdaa47e2ac4423b
BUG: 1474768
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 482010ce502..9e112954811 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) { @@ -5477,15 +5482,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; |