mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-19 19:20:35 +00:00
After some discussion on the asterisk-dev list, we determined that this approach
for extracting application, function, manager, and agi documentation is the wrong one to take. The most severe problem is that the output depends on which modules are loaded as well as compile time options, which both determine which parts are available. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72986 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1673,74 +1673,6 @@ static int help_workhorse(int fd, char *match[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef AST_DEVMODE
|
||||
static char *handle_agi_dump_commanddocs(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
||||
{
|
||||
FILE *f;
|
||||
char *command_name = NULL;
|
||||
const char *fn = "/tmp/ast_agi_commands.tex";
|
||||
int i;
|
||||
|
||||
switch (cmd) {
|
||||
case CLI_INIT:
|
||||
e->command = "agi dump commanddocs";
|
||||
e->usage =
|
||||
"Usage: agi dump commanddocs [command]\n"
|
||||
" Dump manager action documentation to /tmp/ast_agi_commands.tex.\n";
|
||||
return NULL;
|
||||
case CLI_GENERATE:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (a->argc == e->args + 1)
|
||||
command_name = a->argv[e->args];
|
||||
else if (a->argc != e->args)
|
||||
return CLI_SHOWUSAGE;
|
||||
|
||||
if (!(f = fopen(fn, "w+"))) {
|
||||
ast_cli(a->fd, "Unable to open %s for writing!\n", fn);
|
||||
return CLI_FAILURE;
|
||||
}
|
||||
|
||||
fprintf(f, "%% This file is automatically generated by the \"manager dump actiondocs\" CLI command. Any manual edits will be lost.\n");
|
||||
|
||||
/* XXX Not thread safe :( */
|
||||
for (i = 0; i < ARRAY_LEN(commands); i++) {
|
||||
struct agi_command *command;
|
||||
char fullcmd[80];
|
||||
|
||||
command = &commands[i];
|
||||
if (!command->cmda[0])
|
||||
break;
|
||||
|
||||
ast_join(fullcmd, sizeof(fullcmd), command->cmda);
|
||||
|
||||
if (command_name && strcasecmp(fullcmd, command_name))
|
||||
continue;
|
||||
|
||||
fprintf(f, "\\section{%s}\n"
|
||||
"\\subsection{Summary}\n"
|
||||
"\\begin{verbatim}\n"
|
||||
"%s\n"
|
||||
"\\end{verbatim}\n"
|
||||
"\\subsection{Usage}\n"
|
||||
"\\begin{verbatim}\n"
|
||||
"%s\n"
|
||||
"\\end{verbatim}\n\n\n",
|
||||
fullcmd, command->summary, command->usage);
|
||||
|
||||
if (command_name)
|
||||
break;
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
|
||||
ast_cli(a->fd, "Documentation has been dumped to %s\n", fn);
|
||||
|
||||
return CLI_SUCCESS;
|
||||
}
|
||||
#endif /* AST_DEVMODE */
|
||||
|
||||
int ast_agi_register(agi_command *agi)
|
||||
{
|
||||
int x;
|
||||
@@ -2232,10 +2164,6 @@ static struct ast_cli_entry cli_agi[] = {
|
||||
{ { "agi", "dumphtml", NULL },
|
||||
handle_agidumphtml, "Dumps a list of agi commands in html format",
|
||||
dumpagihtml_help },
|
||||
|
||||
#ifdef AST_DEVMODE
|
||||
NEW_CLI(handle_agi_dump_commanddocs, "Dump agi command documentation in LaTeX format"),
|
||||
#endif
|
||||
};
|
||||
|
||||
static int unload_module(void)
|
||||
|
Reference in New Issue
Block a user