summaryrefslogtreecommitdiffstats
path: root/cli/src/registry.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-08-17 03:37:46 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-17 02:23:59 -0700
commite5737546071bd1d38430503bb64b9998bd7870dd (patch)
treec5a9fe82f2474ff6c8792381c1b77384c9f82983 /cli/src/registry.c
parentead92558ee8ec71442b2fa2da1a0df197ee78467 (diff)
cli: Implement help command
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1229 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1229
Diffstat (limited to 'cli/src/registry.c')
-rw-r--r--cli/src/registry.c8
1 files changed, 5 insertions, 3 deletions
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;