diff options
author | Kaushik BV <kaushikbv@gluster.com> | 2010-09-18 03:31:56 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-18 07:02:03 -0700 |
commit | 5c297be9612f76dad6f970092fb6762b4ee4844a (patch) | |
tree | f65290e7f12e8d6913f3f3b8d3ffa8dc4cd06618 /cli/src/cli-cmd-parser.c | |
parent | faa817ea9cb119c7f65fce24f03a172fa4b4ada1 (diff) |
Glusterd: gluster volume set <volume> <option> <value>
Signed-off-by: Kaushik BV <kaushikbv@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1159 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1159
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index daec9c8d6..479df9386 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -322,12 +322,16 @@ cli_cmd_volume_set_parse (const char **words, int wordcount, dict_t **options) if (ret) goto out; - for (i = 3; i < wordcount; i++) { - key = strtok ((char *)words[i], "="); - value = strtok (NULL, "="); - - GF_ASSERT (key); - GF_ASSERT (value); + for (i = 3; i < wordcount; i+=2) { + + key = (char *) words[i]; + value = (char *) words[i+1]; + + if ( !key || !value) { + ret = -1; + cli_out ("Usage: volume set <VOLNAME> <KEY> <VALUE>"); + goto out; + } count++; |