]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make the output of "console list devices" a bit prettier.
authorRussell Bryant <russell@russellbryant.com>
Thu, 17 Jan 2008 23:28:16 +0000 (23:28 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 17 Jan 2008 23:28:16 +0000 (23:28 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99011 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_console.c

index 38bd3e61c7efed8f355450bf3b32b4b3ef6442c9..58f456c39afa869dc4086a72c75b05f1ae4ea9e9 100644 (file)
@@ -787,7 +787,11 @@ static char *cli_list_devices(struct ast_cli_entry *e, int cmd, struct ast_cli_a
        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,15 +805,17 @@ static char *cli_list_devices(struct ast_cli_entry *e, int cmd, struct ast_cli_a
                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;
 }