From 3d912aa905105098db1eea1e4c3e9c42aa0c7da7 Mon Sep 17 00:00:00 2001 From: Rahul Date: Thu, 17 Mar 2011 01:55:43 +0000 Subject: Added checks for fix-layout & migrate-data usage. Signed-off-by: Rahul Signed-off-by: Vijay Bellur BUG: 2547 (rebalance command usage and help mis-match) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2547 --- cli/src/cli-cmd-volume.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'cli/src/cli-cmd-volume.c') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 3bd54a6fb3b..f008384ae64 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -463,6 +463,7 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word, dict_t *dict = NULL; int sent = 0; int parse_error = 0; + int index = 0; #ifdef GF_SOLARIS_HOST_OS cli_out ("Command not supported on Solaris"); goto out; @@ -482,8 +483,20 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word, goto out; } - if (strcmp (words[3], "start") && strcmp (words[3], "stop") && - strcmp (words[3], "status")) { + if (wordcount == 4) { + index = 3; + } else { + if (strcmp (words[3], "fix-layout") && + strcmp (words[3], "migrate-data")) { + cli_usage_out (word->pattern); + parse_error = 1; + goto out; + } + index = 4; + } + + if (strcmp (words[index], "start") && strcmp (words[index], "stop") && + strcmp (words[index], "status")) { cli_usage_out (word->pattern); parse_error = 1; goto out; -- cgit