aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-17 23:28:16 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-17 23:28:16 +0000
commit518c69c2cf5d9b95d6ff452ea1d6a7e78d0e58eb (patch)
tree53c2b0a760c3cedbbdba0e82b16793f464aa1383 /channels
parent54444ec4c8bca23c60f2c348390d07b0b81fb010 (diff)
Make the output of "console list devices" a bit prettier.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@99011 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_console.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/channels/chan_console.c b/channels/chan_console.c
index 38bd3e61c..58f456c39 100644
--- a/channels/chan_console.c
+++ b/channels/chan_console.c
@@ -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;
}