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.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
certified/1.8.6
Eliel C. Sardanons 16 years ago
parent 75cd3f4918
commit 311c997896

@ -612,6 +612,8 @@ static char *handle_showmancmd(struct ast_cli_entry *e, int cmd, struct ast_cli_
" Shows the detailed description for a specific Asterisk manager interface command.\n"; " Shows the detailed description for a specific Asterisk manager interface command.\n";
return NULL; return NULL;
case CLI_GENERATE: case CLI_GENERATE:
if (a->pos == 3) {
/* autocomplete the action name. */
l = strlen(a->word); l = strlen(a->word);
which = 0; which = 0;
AST_RWLIST_RDLOCK(&actions); AST_RWLIST_RDLOCK(&actions);
@ -624,6 +626,9 @@ static char *handle_showmancmd(struct ast_cli_entry *e, int cmd, struct ast_cli_
AST_RWLIST_UNLOCK(&actions); AST_RWLIST_UNLOCK(&actions);
return ret; return ret;
} }
return NULL;
}
authority = ast_str_alloca(80); authority = ast_str_alloca(80);
if (a->argc != 4) { if (a->argc != 4) {
return CLI_SHOWUSAGE; return CLI_SHOWUSAGE;

Loading…
Cancel
Save