diff options
author | Sean Bright <sean.bright@gmail.com> | 2017-02-11 10:57:03 -0500 |
---|---|---|
committer | Sean Bright <sean.bright@gmail.com> | 2017-02-13 11:33:15 -0500 |
commit | 3f9437377809a8c1476a1195474eb3178b2c7934 (patch) | |
tree | 74fd534bc18dcbaf3c7f13d561d647b24899a87d /main/bridge.c | |
parent | 5780492cd725858628c32b42d72152455f2525c3 (diff) |
cli: Fix various CLI documentation and completion issues
* app_minivm: Use built-in completion facilities to complete optional
arguments.
* app_voicemail: Use built-in completion facilities to complete
optional arguments.
* app_confbridge: Add missing colons after 'Usage' text.
* chan_alsa: Use built-in completion facilities to complete optional
arguments.
* chan_sip: Use built-in completion facilities to complete optional
arguments. Add completions for 'load' for 'sip show user', 'sip show
peer', and 'sip qualify peer.'
* chan_skinny: Correct and extend completions for 'skinny reset' and
'skinny show line.'
* func_odbc: Correct completions for 'odbc read' and 'odbc write'
* main/astmm: Use built-in completion facilities to complete arguments
for 'memory' commands.
* main/bridge: Correct completions for 'bridge kick.'
* main/ccss: Use built-in completion facilities to complete arguments
for 'cc cancel' command.
* main/cli: Add 'all' completion for 'channel request hangup.' Correct
completions for 'core set debug channel.' Correct completions for 'core
show calls.'
* main/pbx_app: Remove redundant completions for 'core show
applications.'
* main/pbx_hangup_handler: Remove unused completions for 'core show
hanguphandlers all.'
* res_sorcery_memory_cache: Add completion for 'reload' argument of
'sorcery memory cache stale' and properly implement.
Change-Id: Iee58c7392f6fec34ad9d596109117af87697bbca
Diffstat (limited to 'main/bridge.c')
-rw-r--r-- | main/bridge.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/main/bridge.c b/main/bridge.c index 13c01fa27..b6ba0a2bf 100644 --- a/main/bridge.c +++ b/main/bridge.c @@ -5170,12 +5170,6 @@ static char *complete_bridge_participant(const char *bridge_name, const char *li return NULL; } - if (!state) { - ao2_ref(bridge, -1); - return ast_strdup("all"); - } - state--; - { SCOPED_LOCK(bridge_lock, bridge, ast_bridge_lock, ast_bridge_unlock); @@ -5197,6 +5191,8 @@ static char *complete_bridge_participant(const char *bridge_name, const char *li static char *handle_bridge_kick_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { + static const char * const completions[] = { "all", NULL }; + char *complete; struct ast_bridge *bridge; switch (cmd) { @@ -5213,7 +5209,11 @@ static char *handle_bridge_kick_channel(struct ast_cli_entry *e, int cmd, struct return complete_bridge_live(a->word, a->n); } if (a->pos == 3) { - return complete_bridge_participant(a->argv[2], a->line, a->word, a->pos, a->n); + complete = ast_cli_complete(a->word, completions, a->n); + if (!complete) { + complete = complete_bridge_participant(a->argv[2], a->line, a->word, a->pos, a->n - 1); + } + return complete; } return NULL; } |