diff options
| author | N Balachandran <nbalacha@redhat.com> | 2017-11-06 10:00:54 +0530 | 
|---|---|---|
| committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-11-16 14:37:45 +0000 | 
| commit | 22e14d7f8eb40838a0af8486abfbbd54364e9154 (patch) | |
| tree | 78aed6c064a6319254b3ae13b86415909fc35478 /cli/src/cli-cmd-parser.c | |
| parent | e1f780ca8f17b8b9615356796093dc7a75f5ff8a (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>.
> BUG: 1474768
> Signed-off-by: N Balachandran <nbalacha@redhat.com>
(cherry picked from commit 89dc54f50c9f800ca4446ea8fe736e4860588845)
Change-Id: I263f53a0870d80ef4cfaad455fdaa47e2ac4423b
BUG: 1509789
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;  | 
