]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
don't try to print the help text for a CLI command when RESULT_SHOWUSAGE is
authorRussell Bryant <russell@russellbryant.com>
Mon, 27 Feb 2006 15:20:48 +0000 (15:20 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 27 Feb 2006 15:20:48 +0000 (15:20 +0000)
returned if there is no help text available (issue #6604)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@11281 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cli.c

diff --git a/cli.c b/cli.c
index 4a0f95e540724b9e596082c5d0bb4b10e9527262..e2a646d5b64e1acb00b9451db020f7707d8fd79f 100644 (file)
--- a/cli.c
+++ b/cli.c
@@ -1363,7 +1363,10 @@ int ast_cli_command(int fd, char *s)
                        if (e) {
                                switch(e->handler(fd, x, argv)) {
                                case RESULT_SHOWUSAGE:
-                                       ast_cli(fd, "%s", e->usage);
+                                       if (e->usage)
+                                               ast_cli(fd, "%s", e->usage);
+                                       else
+                                               ast_cli(fd, "%s", "Invalid usage, but no usage information available.\n");
                                        break;
                                }
                        } else