[asterisk-commits] russell: trunk r99011 - /trunk/channels/chan_console.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 17 17:28:16 CST 2008


Author: russell
Date: Thu Jan 17 17:28:16 2008
New Revision: 99011

URL: http://svn.digium.com/view/asterisk?view=rev&rev=99011
Log:
Make the output of "console list devices" a bit prettier.

Modified:
    trunk/channels/chan_console.c

Modified: trunk/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_console.c?view=diff&rev=99011&r1=99010&r2=99011
==============================================================================
--- trunk/channels/chan_console.c (original)
+++ trunk/channels/chan_console.c Thu Jan 17 17:28:16 2008
@@ -787,7 +787,11 @@
 	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 
-	ast_cli(a->fd, "Available Devices:\n---------------------------------\n");
+	ast_cli(a->fd, "\n"
+	            "=============================================================\n"
+	            "=== Available Devices =======================================\n"
+	            "=============================================================\n"
+	            "===\n");
 
 	num = Pa_GetDeviceCount();
 	if (!num) {
@@ -801,14 +805,16 @@
 		const PaDeviceInfo *dev = Pa_GetDeviceInfo(index);
 		if (!dev)
 			continue;
-		ast_cli(a->fd, "Device Name: %s %s %s\n", dev->name,
-			dev->maxInputChannels ? "(Input)" : "",
-			dev->maxOutputChannels ? "(Output)" : "");
-		if (index == def_input)
-			ast_cli(a->fd, "    ---> Default Input Device\n");
-		if (index == def_output)
-			ast_cli(a->fd, "    ---> Default Output Device\n");
-	}
+		ast_cli(a->fd, "=== ---------------------------------------------------------\n"
+		               "=== Device Name: %s\n", dev->name);
+		if (dev->maxInputChannels)
+			ast_cli(a->fd, "=== ---> %sInput Device\n", (index == def_input) ? "Default " : "");
+		if (dev->maxOutputChannels)
+			ast_cli(a->fd, "=== ---> %sOutput Device\n", (index == def_output) ? "Default " : "");
+		ast_cli(a->fd, "=== ---------------------------------------------------------\n===\n");
+	}
+
+	ast_cli(a->fd, "=============================================================\n\n");
 
 	return CLI_SUCCESS;
 }




More information about the asterisk-commits mailing list