summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorKaushik BV <kaushikbv@gluster.com>2011-09-16 14:03:40 +0530
committerVijay Bellur <vijay@gluster.com>2011-09-19 00:19:42 -0700
commit9895baf2719ac9911bc20ca54d0ff84f761baaed (patch)
tree24908ba6902838bbe65b1d7c797867e62cf54c64 /cli
parent0cb13b43c612dffe6aa8ba9367c5f808e725efff (diff)
cli: check wordcount to validate volume set help
Change-Id: I93650af9fb29cffc48733d9bba5fd2fb580c44a1 BUG: 3543 Reviewed-on: http://review.gluster.com/436 Reviewed-by: Vijay Bellur <vijay@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 92626df76b5..a8ac5410640 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -643,10 +643,13 @@ cli_cmd_volume_set_parse (const char **words, int wordcount, dict_t **options)
ret = dict_set_str (dict, "volname", volname);
- if (!strcmp (volname, "help") && !words[3] && !words[4])
+ if (ret)
+ goto out;
+
+ if (!strcmp (volname, "help") && wordcount == 3 )
ret = dict_set_str (dict, "help", volname);
- if (!strcmp (volname, "help-xml") && !words[3] && !words[4])
+ if (!strcmp (volname, "help-xml") && wordcount == 3 )
ret = dict_set_str (dict, "help-xml", volname);
if (ret)