From: Jason Parker Date: Mon, 15 Jan 2007 18:23:21 +0000 (+0000) Subject: re-add deprecated "show version" CLI command. X-Git-Tag: 1.4.1~283 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d49164921b4eaea8348579e34ce23331f33a5e5;p=thirdparty%2Fasterisk.git re-add deprecated "show version" CLI command. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50921 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/asterisk.c b/main/asterisk.c index 71addc1c01..40befc1cd1 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -1368,6 +1368,16 @@ static char version_help[] = "Usage: core show version\n" " Shows Asterisk version information.\n"; +static int handle_version_deprecated(int fd, int argc, char *argv[]) +{ + if (argc != 2) + return RESULT_SHOWUSAGE; + ast_cli(fd, "Asterisk %s built by %s @ %s on a %s running %s on %s\n", + ASTERISK_VERSION, ast_build_user, ast_build_hostname, + ast_build_machine, ast_build_os, ast_build_date); + return RESULT_SUCCESS; +} + static int handle_version(int fd, int argc, char *argv[]) { if (argc != 3) @@ -1519,6 +1529,11 @@ static int show_license(int fd, int argc, char *argv[]) #define ASTERISK_PROMPT2 "%s*CLI> " +static struct ast_cli_entry cli_show_version_deprecated = { + { "show", "version", NULL }, + handle_version_deprecated, "Display version info", + version_help }; + #if !defined(LOW_MEMORY) static struct ast_cli_entry cli_show_version_files_deprecated = { { "show", "version", "files", NULL }, @@ -1574,7 +1589,7 @@ static struct ast_cli_entry cli_asterisk[] = { { { "core", "show", "version", NULL }, handle_version, "Display version info", - version_help }, + version_help, NULL, &cli_show_version_deprecated }, { { "!", NULL }, handle_bang, "Execute a shell command",