mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
cli: Auto-complete File not Module for core set debug.
Since Asterisk 1.8, the command "core set debug" on the command-line interface asks not for a file (.c) but a module name. This change shows modules (.so) on the auto-completion via a tabulator or the question mark. Now, when you partially type a module name, TAB or ?, you get the correct candidiates. ASTERISK-26480 Change-Id: I1213f1dd409bd4ff8de08ad80cb0c73cafb1bae0
This commit is contained in:
14
main/cli.c
14
main/cli.c
@@ -449,19 +449,11 @@ static char *handle_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args
|
|||||||
case CLI_INIT:
|
case CLI_INIT:
|
||||||
e->command = "core set debug";
|
e->command = "core set debug";
|
||||||
e->usage =
|
e->usage =
|
||||||
#if !defined(LOW_MEMORY)
|
|
||||||
"Usage: core set debug [atleast] <level> [module]\n"
|
"Usage: core set debug [atleast] <level> [module]\n"
|
||||||
#else
|
|
||||||
"Usage: core set debug [atleast] <level>\n"
|
|
||||||
#endif
|
|
||||||
" core set debug off\n"
|
" core set debug off\n"
|
||||||
"\n"
|
"\n"
|
||||||
#if !defined(LOW_MEMORY)
|
|
||||||
" Sets level of debug messages to be displayed or\n"
|
" Sets level of debug messages to be displayed or\n"
|
||||||
" sets a module name to display debug messages from.\n"
|
" sets a module name to display debug messages from.\n"
|
||||||
#else
|
|
||||||
" Sets level of debug messages to be displayed.\n"
|
|
||||||
#endif
|
|
||||||
" 0 or off means no messages should be displayed.\n"
|
" 0 or off means no messages should be displayed.\n"
|
||||||
" Equivalent to -d[d[...]] on startup\n";
|
" Equivalent to -d[d[...]] on startup\n";
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -489,13 +481,9 @@ static char *handle_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args
|
|||||||
} else if (a->n == (22 - numbermatch) && a->pos == 3 && ast_strlen_zero(argv3)) {
|
} else if (a->n == (22 - numbermatch) && a->pos == 3 && ast_strlen_zero(argv3)) {
|
||||||
return ast_strdup("atleast");
|
return ast_strdup("atleast");
|
||||||
}
|
}
|
||||||
#if !defined(LOW_MEMORY)
|
|
||||||
} else if ((a->pos == 4 && !atleast && strcasecmp(argv3, "off") && strcasecmp(argv3, "channel"))
|
} else if ((a->pos == 4 && !atleast && strcasecmp(argv3, "off") && strcasecmp(argv3, "channel"))
|
||||||
|| (a->pos == 5 && atleast)) {
|
|| (a->pos == 5 && atleast)) {
|
||||||
const char *pos = S_OR(a->argv[a->pos], "");
|
return ast_module_helper(a->line, a->word, a->pos, a->n, a->pos, 0);
|
||||||
|
|
||||||
return ast_complete_source_filename(pos, a->n);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user