summaryrefslogtreecommitdiff
path: root/cli.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2001-10-11 18:51:39 +0000
committerMark Spencer <markster@digium.com>2001-10-11 18:51:39 +0000
commita23604f544f3cdcbae1224b11e6a21f91f36c795 (patch)
treed5edbec872ca788c4c559357b82418b731c64759 /cli.c
parent31587bd336d9e49c4efa170839592885a2f0c928 (diff)
Version 0.1.9 from FTP
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cli.c')
-rwxr-xr-xcli.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/cli.c b/cli.c
index 98e16a0c8..e12871ad0 100755
--- a/cli.c
+++ b/cli.c
@@ -189,7 +189,7 @@ static int handle_version(int fd, int argc, char *argv[])
{
if (argc != 2)
return RESULT_SHOWUSAGE;
- ast_cli(fd, VERSION_INFO);
+ ast_cli(fd, "%s\n", VERSION_INFO);
return RESULT_SUCCESS;
}
static int handle_chanlist(int fd, int argc, char *argv[])
@@ -345,10 +345,10 @@ static struct ast_cli_entry builtins[] = {
{ { "set", "verbose", NULL }, handle_set_verbose, "Set level of verboseness", set_verbose_help },
{ { "show", "channel", NULL }, handle_showchan, "Display information on a specific channel", showchan_help, complete_ch },
{ { "show", "channels", NULL }, handle_chanlist, "Display information on channels", chanlist_help },
- { { "show", "modules", NULL }, handle_modlist, "List modules and info", modlist_help },
+ { { "show", "modules", NULL }, handle_modlist, "List modules and info", modlist_help },
+ { { "show", "version", NULL }, handle_version, "Display version info", version_help },
{ { "soft", "hangup", NULL }, handle_softhangup, "Request a hangup on a given channel", softhangup_help, complete_ch },
{ { "unload", NULL }, handle_unload, "Unload a dynamic module by name", unload_help, complete_fn },
- { { "version", NULL }, handle_version, "Display version info", version_help },
{ { NULL }, NULL, NULL, NULL }
};
@@ -464,8 +464,8 @@ int ast_cli_register(struct ast_cli_entry *e)
ast_pthread_mutex_lock(&clilock);
join2(fulle, sizeof(fulle), e->cmda);
if (find_cli(e->cmda, -1)) {
- ast_log(LOG_WARNING, "Command '%s' already registered (or something close enough)\n", fulle);
ast_pthread_mutex_unlock(&clilock);
+ ast_log(LOG_WARNING, "Command '%s' already registered (or something close enough)\n", fulle);
return -1;
}
cur = helpers;
@@ -655,7 +655,7 @@ static char *__ast_cli_generator(char *text, char *word, int state, int lock)
join(fullcmd2, sizeof(fullcmd2), e2->cmda);
if (e1->cmda[0])
join(fullcmd1, sizeof(fullcmd1), e1->cmda);
- if (!e1->cmda ||
+ if (!e1->cmda[0] ||
(e2 && (strcmp(fullcmd2, fullcmd1) < 0))) {
/* Use e2 */
e = e2;