diff options
author | mvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-09-06 12:03:11 +0000 |
---|---|---|
committer | mvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-09-06 12:03:11 +0000 |
commit | 02e84822e5e5e46e792b433d8f600e3ba95762cf (patch) | |
tree | ca4cc6ba18e876ee69cbdfd12b5c25bba6d9702b /main/cli.c | |
parent | 3ddf849214c18117c10802b85d85211f19bd42f1 (diff) |
Some fixes to autocompletion in some commands.
Changes applied by this patch:
- Fix autocompletion in 'sip prune realtime', sip peers where never auto completed. Now we complete this command with:
'sip prune realtime peer' -> all | like | sip peers
Also I have modified the syntax in the usage, was wrong...
- Pass ast_cli_args->argv and ast_cli_args->argc while running autocompletion on CLI commands (CLI_GENERATE).
With this we avoid comparisons on ast_cli_args->line like this:
strcasestr(a->line, " description")
strcasestr(a->line, "descriptions ")
strcasestr(a->line, "realtime peer"), and so on..
Making the code more confusing (check the spaces in description!).
The only thing we must be sure is to first check a->pos or a->argc.
- Fix 'iax2 prune realtime' autocompletion, now we autocomplete this command with 'all' & 'iax2 peers', check a look that iax2 peers where all the peers, now only the ones in the cache..
(closes issue #13133)
Reported by: eliel
Patches:
clichanges.patch uploaded by eliel (license 64)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@141464 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cli.c')
-rw-r--r-- | main/cli.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/main/cli.c b/main/cli.c index 8459ea35d..f07d8b015 100644 --- a/main/cli.c +++ b/main/cli.c @@ -1835,7 +1835,9 @@ static char *__ast_cli_generator(const char *text, const char *word, int state, struct ast_cli_args a = { .line = matchstr, .word = word, .pos = argindex, - .n = state - matchnum }; + .n = state - matchnum, + .argv = argv, + .argc = x}; ret = e->handler(e, CLI_GENERATE, &a); } if (ret) |