]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Ensure "rules" is tab-completable for "queue show"
authorKinsey Moore <kmoore@digium.com>
Thu, 6 Sep 2012 14:28:33 +0000 (14:28 +0000)
committerKinsey Moore <kmoore@digium.com>
Thu, 6 Sep 2012 14:28:33 +0000 (14:28 +0000)
Previously, tabbing at the end of "queue show" produced a list of
available queues about which information could be shown, but did not
include an alternative command, "rules", to access information about
queue rules. The "rules" item should now be shown in the list of
tab-completable items.

(closes issue AST-958)
Reported-by: John Bigelow
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@372444 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 95833db20434a53b84f2cc4ff517950121fd2233..ed9406a46bef35d7c09200d4ece5c4b6597c993d 100644 (file)
@@ -7131,6 +7131,12 @@ static char *complete_queue(const char *line, const char *word, int pos, int sta
        }
        ao2_iterator_destroy(&queue_iter);
 
+       /* Pretend "rules" is always at the end of the queues list since it is
+        * an alternate command that should be tab-completable */
+       if (!ret && which == state && !wordlen) {
+               ret = ast_strdup("rules");
+       }
+
        return ret;
 }