diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-24 10:23:51 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-24 10:23:51 +0000 |
commit | 4c6cb8a9b80e3d5e4256c50e2740cafd2fe226b1 (patch) | |
tree | 5cf97cd4ec3eb5170b162d62e12ac34dd9e107cb /cli.c | |
parent | 9e0de68a9fac0ce5464bbd98a28abd0cedf1bd2f (diff) |
print out appropriate message when no help text is available for a command
fix a seg fault when astmm is enabled (bug #4356)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5758 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cli.c')
-rwxr-xr-x | cli.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1065,9 +1065,14 @@ static int handle_help(int fd, int argc, char *argv[]) { return RESULT_SHOWUSAGE; if (argc > 1) { e = find_cli(argv + 1, 1); - if (e) - ast_cli(fd, e->usage); - else { + if (e) { + if (e->usage) + ast_cli(fd, e->usage); + else { + join(fullcmd, sizeof(fullcmd), argv+1); + ast_cli(fd, "No help text available for '%s'.\n", fullcmd); + } + } else { if (find_cli(argv + 1, -1)) { return help_workhorse(fd, argv + 1); } else { |