From e9d6c2ff9b22167c463b055b65e8351dc0a4cc0c Mon Sep 17 00:00:00 2001 From: russell Date: Fri, 8 Feb 2008 21:26:32 +0000 Subject: Merge changes from team/mvanbaak/cli-command-audit (closes issue #8925) About a year ago, as Leif Madsen and Jim van Meggelen were going over the CLI commands in Asterisk 1.4 for the next version of their book, they documented a lot of inconsistencies. This set of changes addresses all of these issues and has been reviewed by Leif. While this does introduce even more changes to the CLI command structure, it makes everything consistent, which is the most important thing. Thanks to all that helped with this one! git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103171 f38db490-d61c-443f-a65b-d21fe96a405b --- main/cdr.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'main/cdr.c') diff --git a/main/cdr.c b/main/cdr.c index 85545be62..488eeee1c 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -1236,16 +1236,16 @@ static char *handle_cli_status(struct ast_cli_entry *e, int cmd, struct ast_cli_ switch (cmd) { case CLI_INIT: - e->command = "cdr status"; + e->command = "cdr show status"; e->usage = - "Usage: cdr status\n" + "Usage: cdr show status\n" " Displays the Call Detail Record engine system status.\n"; return NULL; case CLI_GENERATE: return NULL; } - if (a->argc > 2) + if (a->argc > 3) return CLI_SHOWUSAGE; ast_cli(a->fd, "CDR logging: %s\n", enabled ? "enabled" : "disabled"); @@ -1274,6 +1274,14 @@ static char *handle_cli_status(struct ast_cli_entry *e, int cmd, struct ast_cli_ return CLI_SUCCESS; } +static char *handle_cli_status_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) +{ + char *res = handle_cli_status(e, cmd, a); + if (cmd == CLI_INIT) + e->command = "cdr status"; + return res; +} + static char *handle_cli_submit(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { switch (cmd) { @@ -1296,7 +1304,8 @@ static char *handle_cli_submit(struct ast_cli_entry *e, int cmd, struct ast_cli_ } static struct ast_cli_entry cli_submit = AST_CLI_DEFINE(handle_cli_submit, "Posts all pending batched CDR data"); -static struct ast_cli_entry cli_status = AST_CLI_DEFINE(handle_cli_status, "Display the CDR status"); +static struct ast_cli_entry cli_status_deprecated = AST_CLI_DEFINE(handle_cli_status_deprecated, "Display the CDR status"); +static struct ast_cli_entry cli_status = AST_CLI_DEFINE(handle_cli_status, "Display the CDR status", .deprecate_cmd = &cli_status_deprecated); static int do_reload(int reload) { -- cgit v1.2.3