[asterisk-commits] eliel: trunk r195367 - /trunk/main/manager.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon May 18 15:31:32 CDT 2009
Author: eliel
Date: Mon May 18 15:31:29 2009
New Revision: 195367
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=195367
Log:
Avoid autocompleting passed the action name argument in the CLI command.
When running the autocomplete of the CLI command 'manager show command <action>'
it was autocompleting everything else after the <action> argument, giving an error,
because this command doesn't support multiple AMI action names at a time.
Modified:
trunk/main/manager.c
Modified: trunk/main/manager.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/main/manager.c?view=diff&rev=195367&r1=195366&r2=195367
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Mon May 18 15:31:29 2009
@@ -612,17 +612,22 @@
" Shows the detailed description for a specific Asterisk manager interface command.\n";
return NULL;
case CLI_GENERATE:
- l = strlen(a->word);
- which = 0;
- AST_RWLIST_RDLOCK(&actions);
- AST_RWLIST_TRAVERSE(&actions, cur, list) {
- if (!strncasecmp(a->word, cur->action, l) && ++which > a->n) {
- ret = ast_strdup(cur->action);
- break; /* make sure we exit even if ast_strdup() returns NULL */
- }
- }
- AST_RWLIST_UNLOCK(&actions);
- return ret;
+ if (a->pos == 3) {
+ /* autocomplete the action name. */
+ l = strlen(a->word);
+ which = 0;
+ AST_RWLIST_RDLOCK(&actions);
+ AST_RWLIST_TRAVERSE(&actions, cur, list) {
+ if (!strncasecmp(a->word, cur->action, l) && ++which > a->n) {
+ ret = ast_strdup(cur->action);
+ break; /* make sure we exit even if ast_strdup() returns NULL */
+ }
+ }
+ AST_RWLIST_UNLOCK(&actions);
+ return ret;
+ }
+
+ return NULL;
}
authority = ast_str_alloca(80);
if (a->argc != 4) {
More information about the asterisk-commits
mailing list