[asterisk-commits] russell: trunk r47376 - in /trunk: ./ main/cli.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Nov 9 09:26:47 MST 2006


Author: russell
Date: Thu Nov  9 10:26:47 2006
New Revision: 47376

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47376
Log:
Merged revisions 47375 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r47375 | russell | 2006-11-09 11:24:02 -0500 (Thu, 09 Nov 2006) | 3 lines

Fix "core show channel".  Also, fix tab completion for both "core show channel"
and "core show channels".

........

Modified:
    trunk/   (props changed)
    trunk/main/cli.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/main/cli.c
URL: http://svn.digium.com/view/asterisk/trunk/main/cli.c?view=diff&rev=47376&r1=47375&r2=47376
==============================================================================
--- trunk/main/cli.c (original)
+++ trunk/main/cli.c Thu Nov  9 10:26:47 2006
@@ -727,12 +727,12 @@
 	long elapsed_seconds=0;
 	int hour=0, min=0, sec=0;
 	
-	if (argc != 3)
+	if (argc != 4)
 		return RESULT_SHOWUSAGE;
 	now = ast_tvnow();
-	c = ast_get_channel_by_name_locked(argv[2]);
+	c = ast_get_channel_by_name_locked(argv[3]);
 	if (!c) {
-		ast_cli(fd, "%s is not a known channel\n", argv[2]);
+		ast_cli(fd, "%s is not a known channel\n", argv[3]);
 		return RESULT_SUCCESS;
 	}
 	if(c->cdr) {
@@ -821,7 +821,7 @@
 {
 	static char *choices[] = { "concise", "verbose", NULL };
 
-	return (pos != 2) ? NULL : ast_cli_complete(word, choices, state);
+	return (pos != 3) ? NULL : ast_cli_complete(word, choices, state);
 }
 
 char *ast_complete_channels(const char *line, const char *word, int pos, int state, int rpos)
@@ -848,6 +848,11 @@
 static char *complete_ch_3(const char *line, const char *word, int pos, int state)
 {
 	return ast_complete_channels(line, word, pos, state, 2);
+}
+
+static char *complete_ch_4(const char *line, const char *word, int pos, int state)
+{
+	return ast_complete_channels(line, word, pos, state, 3);
 }
 
 static char *complete_mod_3_nr(const char *line, const char *word, int pos, int state)
@@ -977,7 +982,7 @@
 
 	{ { "core", "show" "channel", NULL },
 	handle_showchan, "Display information on a specific channel",
-	showchan_help, complete_ch_3 },
+	showchan_help, complete_ch_4 },
 
 	{ { "core", "debug", "channel", NULL },
 	handle_debugchan, "Enable debugging on a channel",



More information about the asterisk-commits mailing list