mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
Correct example for CLI autocompletion (generation)
Reported by Atis on #asterisk-dev git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -97,7 +97,7 @@ void ast_cli(int fd, const char *fmt, ...)
|
|||||||
\code
|
\code
|
||||||
static char *test_new_cli(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
static char *test_new_cli(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
||||||
{
|
{
|
||||||
static const char * const choices = { "one", "two", "three", NULL };
|
static const char * const choices[] = { "one", "two", "three", NULL };
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case CLI_INIT:
|
case CLI_INIT:
|
||||||
@@ -181,7 +181,7 @@ struct ast_cli_entry {
|
|||||||
\code
|
\code
|
||||||
char *my_generate(const char *line, const char *word, int pos, int n)
|
char *my_generate(const char *line, const char *word, int pos, int n)
|
||||||
{
|
{
|
||||||
static const char * const choices = { "one", "two", "three", NULL };
|
static const char * const choices[] = { "one", "two", "three", NULL };
|
||||||
if (pos == 2)
|
if (pos == 2)
|
||||||
return ast_cli_complete(word, choices, n);
|
return ast_cli_complete(word, choices, n);
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user