diff options
author | zuul <zuul@gerrit.asterisk.org> | 2017-02-14 14:16:26 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-02-14 14:16:26 -0600 |
commit | 0d6c99e7152c64c624f5662bf6074e15ab71bf80 (patch) | |
tree | 8ea24e532e836ca60dfb5853b7f2e041336e1ff3 /channels/chan_sip.c | |
parent | bc2104819ccb394e88f02705d2a4829f9500ee4b (diff) | |
parent | ea8a610776ca80ddb2302543e32b487896ad2f5c (diff) |
Merge "cli: Fix various CLI documentation and completion issues" into 13
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 15a3b2584..77ea5f2a2 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -19529,7 +19529,7 @@ static char *sip_show_inuse(struct ast_cli_entry *e, int cmd, struct ast_cli_arg switch (cmd) { case CLI_INIT: - e->command = "sip show inuse"; + e->command = "sip show inuse [all]"; e->usage = "Usage: sip show inuse [all]\n" " List all SIP devices usage counters and limits.\n" @@ -19719,7 +19719,7 @@ static char *sip_show_users(struct ast_cli_entry *e, int cmd, struct ast_cli_arg switch (cmd) { case CLI_INIT: - e->command = "sip show users"; + e->command = "sip show users [like]"; e->usage = "Usage: sip show users [like <pattern>]\n" " Lists all known SIP users.\n" @@ -19858,7 +19858,7 @@ static char *sip_show_peers(struct ast_cli_entry *e, int cmd, struct ast_cli_arg { switch (cmd) { case CLI_INIT: - e->command = "sip show peers"; + e->command = "sip show peers [like]"; e->usage = "Usage: sip show peers [like <pattern>]\n" " Lists all known SIP peers.\n" @@ -20572,7 +20572,12 @@ static char *sip_show_peer(struct ast_cli_entry *e, int cmd, struct ast_cli_args " Option \"load\" forces lookup of peer in realtime storage.\n"; return NULL; case CLI_GENERATE: - return complete_sip_show_peer(a->line, a->word, a->pos, a->n); + if (a->pos == 4) { + static const char * const completions[] = { "load", NULL }; + return ast_cli_complete(a->word, completions, a->n); + } else { + return complete_sip_show_peer(a->line, a->word, a->pos, a->n); + } } return _sip_show_peer(0, a->fd, NULL, NULL, a->argc, (const char **) a->argv); } @@ -20742,7 +20747,12 @@ static char *sip_qualify_peer(struct ast_cli_entry *e, int cmd, struct ast_cli_a " Option \"load\" forces lookup of peer in realtime storage.\n"; return NULL; case CLI_GENERATE: - return complete_sip_show_peer(a->line, a->word, a->pos, a->n); + if (a->pos == 4) { + static const char * const completions[] = { "load", NULL }; + return ast_cli_complete(a->word, completions, a->n); + } else { + return complete_sip_show_peer(a->line, a->word, a->pos, a->n); + } } return _sip_qualify_peer(0, a->fd, NULL, NULL, a->argc, (const char **) a->argv); } @@ -21113,7 +21123,12 @@ static char *sip_show_user(struct ast_cli_entry *e, int cmd, struct ast_cli_args " Option \"load\" forces lookup of peer in realtime storage.\n"; return NULL; case CLI_GENERATE: - return complete_sip_show_user(a->line, a->word, a->pos, a->n); + if (a->pos == 4) { + static const char * const completions[] = { "load", NULL }; + return ast_cli_complete(a->word, completions, a->n); + } else { + return complete_sip_show_user(a->line, a->word, a->pos, a->n); + } } if (a->argc < 4) |