diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-03 18:13:26 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-03 18:13:26 +0000 |
commit | 170b60b222018c6b5fb61d545af92e9855bc1811 (patch) | |
tree | 8820f6aef121876024ada4533671a876150be940 /main/cli.c | |
parent | ffd2ffe51c1ee2be76b2aaac37dfb3c5315fdb43 (diff) |
Fix "core show channels" and "core show modules".
Not sure it applies like this to 1.4 because of
deprecate versions of the same command(s).
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47129 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cli.c')
-rw-r--r-- | main/cli.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/main/cli.c b/main/cli.c index ec576cfe8..ba299b5f8 100644 --- a/main/cli.c +++ b/main/cli.c @@ -416,15 +416,16 @@ static int handle_showuptime(int fd, int argc, char *argv[]) return RESULT_SUCCESS; } +/* core show modules [like keyword] */ static int handle_modlist(int fd, int argc, char *argv[]) { char *like = ""; - if (argc == 3) + if (argc != 3 && argc != 5) return RESULT_SHOWUSAGE; - else if (argc >= 4) { - if (strcmp(argv[2],"like")) + else if (argc == 5) { + if (strcmp(argv[3],"like")) return RESULT_SHOWUSAGE; - like = argv[3]; + like = argv[4]; } ast_mutex_lock(&climodentrylock); @@ -438,6 +439,7 @@ static int handle_modlist(int fd, int argc, char *argv[]) #undef MODLIST_FORMAT #undef MODLIST_FORMAT2 +/* core show channels [concise|verbose] */ static int handle_chanlist(int fd, int argc, char *argv[]) { #define FORMAT_STRING "%-20.20s %-20.20s %-7.7s %-30.30s\n" @@ -454,10 +456,12 @@ static int handle_chanlist(int fd, int argc, char *argv[]) int durh, durm, durs; int numchans = 0, concise = 0, verbose = 0; - concise = (argc == 3 && (!strcasecmp(argv[2],"concise"))); - verbose = (argc == 3 && (!strcasecmp(argv[2],"verbose"))); + if (argc == 4) { + concise = !strcasecmp(argv[2],"concise"); + verbose = !strcasecmp(argv[2],"verbose"); + } - if (argc < 2 || argc > 3 || (argc == 3 && !concise && !verbose)) + if (argc < 3 || argc > 4 || (argc == 4 && !concise && !verbose)) return RESULT_SHOWUSAGE; if (!concise && !verbose) |