From a0c874f09e294ec75a18a5436bd01eaa97f22f81 Mon Sep 17 00:00:00 2001 From: Kaushik BV Date: Wed, 25 Aug 2010 01:58:23 +0000 Subject: Help Added to the Gluster-CLI for all sub commands (some deletions in the old patch) Signed-off-by: Kaushik BV Signed-off-by: Anand V. Avati BUG: 1156 (gluster --help should display all the options) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1156 --- cli/src/cli-cmd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cli/src/cli-cmd.c') diff --git a/cli/src/cli-cmd.c b/cli/src/cli-cmd.c index e526fe8895d..ae4e2db2c1f 100644 --- a/cli/src/cli-cmd.c +++ b/cli/src/cli-cmd.c @@ -44,6 +44,9 @@ static pthread_mutex_t conn_mutex = PTHREAD_MUTEX_INITIALIZER; int cli_op_ret = 0; int connected = 0; +int cli_cmd_log_help_cbk (struct cli_state *state, struct cli_cmd_word *in_word, + const char **words, int wordcount); + static gf_boolean_t cli_cmd_needs_connection (struct cli_cmd_word *word) { @@ -92,6 +95,9 @@ cli_cmd_process (struct cli_state *state, int argc, char **argv) return -1; } + if ( strcmp (word->word,"--help")==0 ) + goto callback; + await_conn = cli_cmd_needs_connection (word); if (await_conn) { @@ -104,7 +110,7 @@ cli_cmd_process (struct cli_state *state, int argc, char **argv) } } - +callback: ret = word->cbkfn (state, word, (const char **)argv, argc); return ret; -- cgit