From e5737546071bd1d38430503bb64b9998bd7870dd Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Tue, 17 Aug 2010 03:37:46 +0000 Subject: cli: Implement help command Signed-off-by: Vijay Bellur Signed-off-by: Anand V. Avati BUG: 1229 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1229 --- cli/src/registry.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cli/src/registry.c') diff --git a/cli/src/registry.c b/cli/src/registry.c index 0ced00787..f7e366fd6 100644 --- a/cli/src/registry.c +++ b/cli/src/registry.c @@ -318,7 +318,8 @@ cli_cmd_newword (struct cli_cmd_word *word, const char *token) int -cli_cmd_ingest (struct cli_cmd_tree *tree, char **tokens, cli_cmd_cbk_t *cbkfn) +cli_cmd_ingest (struct cli_cmd_tree *tree, char **tokens, cli_cmd_cbk_t *cbkfn, + const char *desc) { int ret = 0; char **tokenp = NULL; @@ -349,6 +350,7 @@ cli_cmd_ingest (struct cli_cmd_tree *tree, char **tokens, cli_cmd_cbk_t *cbkfn) } word->cbkfn = cbkfn; + word->desc = desc; /* end of static strings in command template */ @@ -360,7 +362,7 @@ cli_cmd_ingest (struct cli_cmd_tree *tree, char **tokens, cli_cmd_cbk_t *cbkfn) int cli_cmd_register (struct cli_cmd_tree *tree, const char *template, - cli_cmd_cbk_t cbk) + cli_cmd_cbk_t cbk, const char *desc) { char **tokens = NULL; int ret = 0; @@ -372,7 +374,7 @@ cli_cmd_register (struct cli_cmd_tree *tree, const char *template, if (!tokens) return -1; - ret = cli_cmd_ingest (tree, tokens, cbk); + ret = cli_cmd_ingest (tree, tokens, cbk, desc); if (ret) goto err; -- cgit