merge qwell's CLI verbification work

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2006-09-18 19:54:18 +00:00
parent fb23c753d3
commit fcb999c01c
53 changed files with 4233 additions and 1186 deletions

View File

@@ -1302,7 +1302,7 @@ static char debug_usage[] =
" Enables dumping of AGI transactions for debugging purposes\n";
static char no_debug_usage[] =
"Usage: agi no debug\n"
"Usage: agi nodebug\n"
" Disables dumping of AGI transactions for debugging purposes\n";
static int agi_do_debug(int fd, int argc, char *argv[])
@@ -1314,7 +1314,7 @@ static int agi_do_debug(int fd, int argc, char *argv[])
return RESULT_SUCCESS;
}
static int agi_no_debug(int fd, int argc, char *argv[])
static int agi_no_debug_deprecated(int fd, int argc, char *argv[])
{
if (argc != 3)
return RESULT_SHOWUSAGE;
@@ -1323,11 +1323,14 @@ static int agi_no_debug(int fd, int argc, char *argv[])
return RESULT_SUCCESS;
}
static struct ast_cli_entry cli_debug =
{ { "agi", "debug", NULL }, agi_do_debug, "Enable AGI debugging", debug_usage };
static struct ast_cli_entry cli_no_debug =
{ { "agi", "no", "debug", NULL }, agi_no_debug, "Disable AGI debugging", no_debug_usage };
static int agi_no_debug(int fd, int argc, char *argv[])
{
if (argc != 2)
return RESULT_SHOWUSAGE;
agidebug = 0;
ast_cli(fd, "AGI Debugging Disabled\n");
return RESULT_SUCCESS;
}
static int handle_noop(struct ast_channel *chan, AGI *agi, int arg, char *argv[])
{
@@ -1924,7 +1927,7 @@ static int handle_showagi(int fd, int argc, char *argv[])
return RESULT_SUCCESS;
}
static int handle_dumpagihtml(int fd, int argc, char *argv[])
static int handle_agidumphtml(int fd, int argc, char *argv[])
{
struct agi_command *e;
char fullcmd[80];
@@ -2080,29 +2083,53 @@ static int deadagi_exec(struct ast_channel *chan, void *data)
}
static char showagi_help[] =
"Usage: show agi [topic]\n"
"Usage: agi list [topic]\n"
" When called with a topic as an argument, displays usage\n"
" information on the given command. If called without a\n"
" topic, it provides a list of AGI commands.\n";
static char dumpagihtml_help[] =
"Usage: dump agihtml <filename>\n"
"Usage: agi dumphtml <filename>\n"
" Dumps the agi command list in html format to given filename\n";
static struct ast_cli_entry showagi =
{ { "show", "agi", NULL }, handle_showagi, "Show AGI commands or specific help", showagi_help };
static struct ast_cli_entry cli_show_agi_deprecated = {
{ "show", "agi", NULL },
handle_showagi, NULL,
NULL };
static struct ast_cli_entry dumpagihtml =
{ { "dump", "agihtml", NULL }, handle_dumpagihtml, "Dumps a list of agi command in html format", dumpagihtml_help };
static struct ast_cli_entry cli_dump_agihtml_deprecated = {
{ "dump", "agihtml", NULL },
handle_agidumphtml, NULL,
NULL };
static struct ast_cli_entry cli_agi_no_debug_deprecated = {
{ "agi", "no", "debug", NULL },
agi_no_debug_deprecated, NULL,
NULL };
static struct ast_cli_entry cli_agi[] = {
{ { "agi", "debug", NULL },
agi_do_debug, "Enable AGI debugging",
debug_usage },
{ { "agi", "nodebug", NULL },
agi_no_debug, "Disable AGI debugging",
no_debug_usage, NULL, &cli_agi_no_debug_deprecated },
{ { "agi", "list", NULL },
handle_showagi, "List AGI commands or specific help",
showagi_help, NULL, &cli_show_agi_deprecated },
{ { "agi", "dumphtml", NULL },
handle_agidumphtml, "Dumps a list of agi commands in html format",
dumpagihtml_help, NULL, &cli_dump_agihtml_deprecated },
};
static int unload_module(void)
{
ast_module_user_hangup_all();
ast_cli_unregister(&showagi);
ast_cli_unregister(&dumpagihtml);
ast_cli_unregister(&cli_debug);
ast_cli_unregister(&cli_no_debug);
ast_cli_unregister_multiple(cli_agi, sizeof(cli_agi) / sizeof(struct ast_cli_entry));
ast_unregister_application(eapp);
ast_unregister_application(deadapp);
return ast_unregister_application(app);
@@ -2110,10 +2137,7 @@ static int unload_module(void)
static int load_module(void)
{
ast_cli_register(&showagi);
ast_cli_register(&dumpagihtml);
ast_cli_register(&cli_debug);
ast_cli_register(&cli_no_debug);
ast_cli_register_multiple(cli_agi, sizeof(cli_agi) / sizeof(struct ast_cli_entry));
ast_register_application(deadapp, deadagi_exec, deadsynopsis, descrip);
ast_register_application(eapp, eagi_exec, esynopsis, descrip);
return ast_register_application(app, agi_exec, synopsis, descrip);