Merged revisions 47051 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r47051 | tilghman | 2006-11-02 17:00:20 -0600 (Thu, 02 Nov 2006) | 2 lines

Reverse change of "show" to "list" and make several other commands more consistent with "category verb arguments"

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2006-11-02 23:16:09 +00:00
parent 7f7f2fe821
commit 10875731ec
26 changed files with 199 additions and 196 deletions

View File

@@ -4010,12 +4010,12 @@ static int reload_queues(void)
return 1;
}
static int __queues_show(struct mansession *s, int manager, int fd, int argc, char **argv, int queue_show)
static int __queues_show(struct mansession *s, int manager, int fd, int argc, char **argv)
{
struct call_queue *q;
struct queue_ent *qe;
struct member *mem;
int pos;
int pos, queue_show;
time_t now;
char max_buf[80];
char *max;
@@ -4024,7 +4024,11 @@ static int __queues_show(struct mansession *s, int manager, int fd, int argc, ch
char *term = manager ? "\r\n" : "\n";
time(&now);
if ((!queue_show && argc != 2) || (queue_show && argc != 3))
if (argc == 2)
queue_show = 0;
else if (argc == 3)
queue_show = 1;
else
return RESULT_SHOWUSAGE;
/* We only want to load realtime queues when a specific queue is asked for. */
@@ -4138,14 +4142,9 @@ static int __queues_show(struct mansession *s, int manager, int fd, int argc, ch
return RESULT_SUCCESS;
}
static int queue_list(int fd, int argc, char **argv)
{
return __queues_show(NULL, 0, fd, argc, argv, 0);
}
static int queue_show(int fd, int argc, char **argv)
{
return __queues_show(NULL, 0, fd, argc, argv, 1);
return __queues_show(NULL, 0, fd, argc, argv);
}
static char *complete_queue(const char *line, const char *word, int pos, int state)
@@ -4172,9 +4171,9 @@ static char *complete_queue(const char *line, const char *word, int pos, int sta
*/
static int manager_queues_show( struct mansession *s, struct message *m )
{
char *a[] = { "queue", "list" };
char *a[] = { "queue", "show" };
__queues_show(s, 1, -1, 2, a, 0);
__queues_show(s, 1, -1, 2, a);
astman_append(s, "\r\n\r\n"); /* Properly terminate Manager output */
return RESULT_SUCCESS;
@@ -4584,10 +4583,6 @@ static char *complete_queue_remove_member(const char *line, const char *word, in
return NULL;
}
static char queue_list_usage[] =
"Usage: queue list\n"
" Provides summary information on call queues.\n";
static char queue_show_usage[] =
"Usage: queue show\n"
" Provides summary information on a specified queue.\n";
@@ -4599,10 +4594,6 @@ static char qrm_cmd_usage[] =
"Usage: queue remove member <channel> from <queue>\n";
static struct ast_cli_entry cli_queue[] = {
{ { "queue", "list", NULL },
queue_list, "Show status of queues",
queue_list_usage, NULL, NULL },
{ { "queue", "show", NULL },
queue_show, "Show status of a specified queue",
queue_show_usage, complete_queue, NULL },