mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +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:
67
main/cli.c
67
main/cli.c
@@ -972,10 +972,6 @@ static struct ast_cli_entry cli_module_unload_deprecated = NEW_CLI(handle_unload
|
||||
|
||||
static char *handle_help(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
|
||||
|
||||
#ifdef AST_DEVMODE
|
||||
static char *handle_core_dump_clidocs(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
|
||||
#endif
|
||||
|
||||
static struct ast_cli_entry cli_cli[] = {
|
||||
/* Deprecated, but preferred command is now consolidated (and already has a deprecated command for it). */
|
||||
NEW_CLI(handle_nodebugchan_deprecated, "Disable debugging on channel(s)"),
|
||||
@@ -1014,10 +1010,6 @@ static struct ast_cli_entry cli_cli[] = {
|
||||
{ { "soft", "hangup", NULL },
|
||||
handle_softhangup, "Request a hangup on a given channel",
|
||||
softhangup_help, complete_ch_3 },
|
||||
|
||||
#ifdef AST_DEVMODE
|
||||
NEW_CLI(handle_core_dump_clidocs, "Dump CLI command documentation in LaTeX format"),
|
||||
#endif
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -1458,65 +1450,6 @@ static char *handle_help(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef AST_DEVMODE
|
||||
static char *handle_core_dump_clidocs(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
||||
{
|
||||
struct ast_cli_entry *cli;
|
||||
FILE *f;
|
||||
const char *fn = "/tmp/ast_cli_commands.tex";
|
||||
struct cli_iterator i = { NULL, NULL};
|
||||
|
||||
switch (cmd) {
|
||||
case CLI_INIT:
|
||||
e->command = "core dump clidocs";
|
||||
e->usage =
|
||||
"Usage: core dump clidocs\n"
|
||||
" Dump CLI command documentation to /tmp/ast_cli_commands.tex.\n";
|
||||
return NULL;
|
||||
case CLI_GENERATE:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
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 \"core dump clidocs\" CLI command. Any manual edits will be lost.\n");
|
||||
|
||||
AST_LIST_LOCK(&helpers);
|
||||
while ((cli = cli_next(&i))) {
|
||||
/* Hide commands that start with '_' */
|
||||
if (cli->_full_cmd[0] == '_')
|
||||
continue;
|
||||
/* Hide commands that are marked as deprecated. */
|
||||
if (cli->deprecated)
|
||||
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",
|
||||
cli->_full_cmd, cli->summary, cli->usage);
|
||||
}
|
||||
AST_LIST_UNLOCK(&helpers);
|
||||
|
||||
fclose(f);
|
||||
|
||||
ast_cli(a->fd, "Documentation has been dumped to %s\n", fn);
|
||||
|
||||
return CLI_SUCCESS;
|
||||
}
|
||||
#endif /* AST_DEVMODE */
|
||||
|
||||
static char *parse_args(const char *s, int *argc, char *argv[], int max, int *trailingwhitespace)
|
||||
{
|
||||
char *dup, *cur;
|
||||
|
Reference in New Issue
Block a user