diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-17 22:02:15 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-17 22:02:15 +0000 |
commit | f908b78fdb35440aae36694d54c5cbb020529267 (patch) | |
tree | c411d1491958e0eecd7179af0d7ae4bf36884715 /main/cli.c | |
parent | 9f5ca42bcf530df3ddcdc91a0c849e7c565122a3 (diff) |
standardize "module show [like]"
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47815 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cli.c')
-rw-r--r-- | main/cli.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/main/cli.c b/main/cli.c index 30836fc75..5e799da1e 100644 --- a/main/cli.c +++ b/main/cli.c @@ -425,7 +425,7 @@ static char *handle_modlist(struct ast_cli_entry *e, int cmd, struct ast_cli_arg switch (cmd) { case CLI_INIT: - e->command = "module show"; + e->command = "module show [like]"; e->usage = "Usage: module show [like keyword]\n" " Shows Asterisk modules currently in use, and usage statistics.\n"; @@ -433,8 +433,6 @@ static char *handle_modlist(struct ast_cli_entry *e, int cmd, struct ast_cli_arg case CLI_GENERATE: if (a->pos == e->args) - return a->n == 0 ? strdup("like") : NULL; - else if (a->pos == e->args+1 && strcasestr(a->line," like ")) return ast_module_helper(a->line, a->word, a->pos, a->n, a->pos, 0); else return NULL; @@ -442,10 +440,10 @@ static char *handle_modlist(struct ast_cli_entry *e, int cmd, struct ast_cli_arg /* all the above return, so we proceed with the handler. * we are guaranteed to have argc >= e->args */ - if (a->argc == e->args) + if (a->argc == e->args - 1) like = ""; - else if (a->argc == e->args + 2 && !strcmp(a->argv[e->args],"like")) - like = a->argv[e->args + 1]; + else if (a->argc == e->args + 1 && !strcasecmp(a->argv[e->args-1], "like") ) + like = a->argv[e->args]; else return CLI_SHOWUSAGE; |