summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
-rw-r--r--cli/src/cli-cmd-parser.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index e5fb4089dab..310c5f06033 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -1657,9 +1657,6 @@ cli_cmd_volume_detach_tier_parse (const char **words, int wordcount,
int32_t command = GF_OP_CMD_NONE;
int force = 0;
- if (!((wordcount == 4) || (wordcount == 5)))
- goto out;
-
dict = dict_new ();
if (!dict)
goto out;
@@ -1668,10 +1665,23 @@ cli_cmd_volume_detach_tier_parse (const char **words, int wordcount,
if (ret)
goto out;
+ if (wordcount == 3 && !strcmp ((char *)words[2], "help")) {
+ return -1;
+ }
+
+ if (!((wordcount == 4) || (wordcount == 5))) {
+ ret = -1;
+ goto out;
+ }
+
if (wordcount == 5) {
word = (char *)words[4];
if (!strcmp(word, "force"))
force = 1;
+ else {
+ ret = -1;
+ goto out;
+ }
}
word = (char *)words[3];