summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-11-21 05:24:07 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-11-21 05:24:07 -0600
commitf5b2746355682b9348144b0878769ce80e72503a (patch)
treed493b52e7781e0ab7e408750c6b6c49b1d92032a /include/asterisk
parentdef556237a14cd47e00a25efcaf9b1ae3d2ab2d6 (diff)
parent14d60cee0c94d95fd63312fcf2faf5abf679e017 (diff)
Merge "CLI: Create ast_cli_completion_vector."
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/cli.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/asterisk/cli.h b/include/asterisk/cli.h
index c79a4e93c..3ed88eb61 100644
--- a/include/asterisk/cli.h
+++ b/include/asterisk/cli.h
@@ -306,6 +306,27 @@ int ast_cli_generatornummatches(const char *, const char *);
char **ast_cli_completion_matches(const char *, const char *);
/*!
+ * \brief Generates a vector of strings for CLI completion.
+ *
+ * \param text Complete input being matched.
+ * \param word Current word being matched
+ *
+ * The results contain strings that both:
+ * 1) Begin with the string in \a word.
+ * 2) Are valid in a command after the string in \a text.
+ *
+ * The first entry (offset 0) of the result is the longest common substring
+ * in the results, useful to extend the string that has been completed.
+ * Subsequent entries are all possible values.
+ *
+ * \note All strings and the vector itself are malloc'ed and must be freed
+ * by the caller.
+ *
+ * \note The vector is sorted and does not contain any duplicates.
+ */
+struct ast_vector_string *ast_cli_completion_vector(const char *text, const char *word);
+
+/*!
* \brief Command completion for the list of active channels.
*
* This can be called from a CLI command completion function that wants to