diff options
author | Joshua Colp <jcolp@digium.com> | 2017-11-21 05:23:58 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-11-21 05:23:58 -0600 |
commit | 29bf57ff2f995b710846263110c2354729a42014 (patch) | |
tree | eef5b13f6bfa2df241e31d94036d444d7c3b280e /include | |
parent | 4045cb4df971d3fe5fa3bc09514db5a25830fa3a (diff) | |
parent | 0b8b153d3c30f192725dcf3640f716331b24640f (diff) |
Merge "CLI: Create ast_cli_completion_vector." into 13
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/cli.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/asterisk/cli.h b/include/asterisk/cli.h index c51d89eb8..7bf473c61 100644 --- a/include/asterisk/cli.h +++ b/include/asterisk/cli.h @@ -301,6 +301,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 |