[svn-commits] mvanbaak: branch group/res_clialiases r147630 - in /team/group/res_clialiases...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Wed Oct 8 14:34:09 CDT 2008
Author: mvanbaak
Date: Wed Oct 8 14:34:08 2008
New Revision: 147630
URL: http://svn.digium.com/view/asterisk?view=rev&rev=147630
Log:
remove the handling of deprecated CLI commands because we dont have those anymore
Modified:
team/group/res_clialiases/include/asterisk/cli.h
team/group/res_clialiases/main/cli.c
Modified: team/group/res_clialiases/include/asterisk/cli.h
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/include/asterisk/cli.h?view=diff&rev=147630&r1=147629&r2=147630
==============================================================================
--- team/group/res_clialiases/include/asterisk/cli.h (original)
+++ team/group/res_clialiases/include/asterisk/cli.h Wed Oct 8 14:34:08 2008
@@ -154,21 +154,19 @@
const char *summary; /*!< Summary of the command (< 60 characters) */
const char *usage; /*!< Detailed usage information */
- struct ast_cli_entry *deprecate_cmd;
+ //struct ast_cli_entry *deprecate_cmd;
int inuse; /*!< For keeping track of usage */
struct module *module; /*!< module this belongs to */
char *_full_cmd; /*!< built at load time from cmda[] */
int cmdlen; /*!< len up to the first invalid char [<{% */
/*! \brief This gets set in ast_cli_register()
- It then gets set to something different when the deprecated command
- is run for the first time (ie; after we warn the user that it's deprecated)
*/
int args; /*!< number of non-null entries in cmda */
char *command; /*!< command, non-null for new-style entries */
- int deprecated;
+ //int deprecated;
cli_fn handler;
- char *_deprecated_by; /*!< copied from the "parent" _full_cmd, on deprecated commands */
+ //char *_deprecated_by; /*!< copied from the "parent" _full_cmd, on deprecated commands */
/*! For linking */
AST_LIST_ENTRY(ast_cli_entry) list;
};
Modified: team/group/res_clialiases/main/cli.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/main/cli.c?view=diff&rev=147630&r1=147629&r2=147630
==============================================================================
--- team/group/res_clialiases/main/cli.c (original)
+++ team/group/res_clialiases/main/cli.c Wed Oct 8 14:34:08 2008
@@ -1372,9 +1372,6 @@
static int __ast_cli_unregister(struct ast_cli_entry *e, struct ast_cli_entry *ed)
{
- if (e->deprecate_cmd) {
- __ast_cli_unregister(e->deprecate_cmd, e);
- }
if (e->inuse) {
ast_log(LOG_WARNING, "Can't remove command that is in use\n");
} else {
@@ -1426,19 +1423,6 @@
}
if (set_full_cmd(e))
goto done;
- if (!ed) {
- e->deprecated = 0;
- } else {
- e->deprecated = 1;
- e->summary = ed->summary;
- e->usage = ed->usage;
- /* XXX If command A deprecates command B, and command B deprecates command C...
- Do we want to show command A or command B when telling the user to use new syntax?
- This currently would show command A.
- To show command B, you just need to always use ed->_full_cmd.
- */
- e->_deprecated_by = S_OR(ed->_deprecated_by, ed->_full_cmd);
- }
lf = e->cmdlen;
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&helpers, cur, list) {
@@ -1459,11 +1443,6 @@
done:
AST_RWLIST_UNLOCK(&helpers);
- if (e->deprecate_cmd) {
- /* This command deprecates another command. Register that one also. */
- __ast_cli_register(e->deprecate_cmd, e);
- }
-
return ret;
}
@@ -1522,9 +1501,6 @@
while ( (e = cli_next(e)) ) {
/* Hide commands that start with '_' */
if (e->_full_cmd[0] == '_')
- continue;
- /* Hide commands that are marked as deprecated. */
- if (e->deprecated)
continue;
if (match && strncasecmp(matchstr, e->_full_cmd, len))
continue;
@@ -1849,19 +1825,9 @@
if (retval == CLI_SHOWUSAGE) {
ast_cli(fd, "%s", S_OR(e->usage, "Invalid usage, but no usage information available.\n"));
- AST_RWLIST_RDLOCK(&helpers);
- if (e->deprecated)
- ast_cli(fd, "The '%s' command is deprecated and will be removed in a future release. Please use '%s' instead.\n", e->_full_cmd, e->_deprecated_by);
- AST_RWLIST_UNLOCK(&helpers);
} else {
if (retval == CLI_FAILURE)
ast_cli(fd, "Command '%s' failed.\n", s);
- AST_RWLIST_RDLOCK(&helpers);
- if (e->deprecated == 1) {
- ast_cli(fd, "The '%s' command is deprecated and will be removed in a future release. Please use '%s' instead.\n", e->_full_cmd, e->_deprecated_by);
- e->deprecated = 2;
- }
- AST_RWLIST_UNLOCK(&helpers);
}
ast_atomic_fetchadd_int(&e->inuse, -1);
done:
More information about the svn-commits
mailing list