diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-18 19:54:18 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-18 19:54:18 +0000 |
commit | 5aacb6a82d4cf625774fa1ea39ca193a3be73b35 (patch) | |
tree | cf63baa167f81c95d3dbf417f83681851decad80 /main/channel.c | |
parent | 4de5810a0530bca0665eadcfb06ef06fd2e86758 (diff) |
merge qwell's CLI verbification work
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43212 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/main/channel.c b/main/channel.c index 24fe88a25..9c9f1daa3 100644 --- a/main/channel.c +++ b/main/channel.c @@ -288,18 +288,32 @@ static char *complete_channeltypes(const char *line, const char *word, int pos, } static char show_channeltypes_usage[] = -"Usage: show channeltypes\n" -" Shows available channel types registered in your Asterisk server.\n"; +"Usage: channeltype list\n" +" Lists available channel types registered in your Asterisk server.\n"; static char show_channeltype_usage[] = -"Usage: show channeltype <name>\n" +"Usage: channeltype show <name>\n" " Show details about the specified channel type, <name>.\n"; -static struct ast_cli_entry cli_show_channeltypes = - { { "show", "channeltypes", NULL }, show_channeltypes, "Show available channel types", show_channeltypes_usage }; +static struct ast_cli_entry cli_show_channeltypes_deprecated = { + { "show", "channeltypes", NULL }, + show_channeltypes, NULL, + NULL }; -static struct ast_cli_entry cli_show_channeltype = - { { "show", "channeltype", NULL }, show_channeltype, "Give more details on that channel type", show_channeltype_usage, complete_channeltypes }; +static struct ast_cli_entry cli_show_channeltype_deprecated = { + { "show", "channeltype", NULL }, + show_channeltype, NULL, + NULL, complete_channeltypes }; + +static struct ast_cli_entry cli_channel[] = { + { { "channeltype", "list", NULL }, + show_channeltypes, "List available channel types", + show_channeltypes_usage, NULL, &cli_show_channeltypes_deprecated }, + + { { "channeltype", "show", NULL }, + show_channeltype, "Give more details on that channel type", + show_channeltype_usage, complete_channeltypes, &cli_show_channeltype_deprecated }, +}; /*! \brief Checks to see if a channel is needing hang up */ int ast_check_hangup(struct ast_channel *chan) @@ -4149,8 +4163,7 @@ void ast_moh_cleanup(struct ast_channel *chan) void ast_channels_init(void) { - ast_cli_register(&cli_show_channeltypes); - ast_cli_register(&cli_show_channeltype); + ast_cli_register_multiple(cli_channel, sizeof(cli_channel) / sizeof(struct ast_cli_entry)); } /*! \brief Print call group and pickup group ---*/ |