mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 14:44:28 +00:00
This commit was manufactured by cvs2svn to create tag 'v0_9_0'.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/v0_9_0@2684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
8
cli.c
8
cli.c
@@ -186,6 +186,8 @@ static char *format_uptimestr(time_t timeval)
|
||||
#define WEEK (DAY*7)
|
||||
#define YEAR (DAY*365)
|
||||
|
||||
if (timeval < 0)
|
||||
return NULL;
|
||||
if (timeval > YEAR) {
|
||||
years = (timeval / YEAR);
|
||||
timeval -= (years * YEAR);
|
||||
@@ -551,7 +553,7 @@ static char *complete_fn(char *line, char *word, int pos, int state)
|
||||
static int handle_help(int fd, int argc, char *argv[]);
|
||||
|
||||
static struct ast_cli_entry builtins[] = {
|
||||
/* Keep alphabetized */
|
||||
/* Keep alphabetized, with longer matches first (example: abcd before abc) */
|
||||
{ { "_command", "complete", NULL }, handle_commandcomplete, "Command complete", commandcomplete_help },
|
||||
{ { "_command", "nummatches", NULL }, handle_commandnummatches, "Returns number of command matches", commandnummatches_help },
|
||||
{ { "_command", "matchesarray", NULL }, handle_commandmatchesarray, "Returns command matches array", commandmatchesarray_help },
|
||||
@@ -561,8 +563,8 @@ static struct ast_cli_entry builtins[] = {
|
||||
{ { "no", "debug", "channel", NULL }, handle_nodebugchan, "Disable debugging on a channel", nodebugchan_help, complete_ch },
|
||||
{ { "reload", NULL }, handle_reload, "Reload configuration", reload_help },
|
||||
{ { "set", "verbose", NULL }, handle_set_verbose, "Set level of verboseness", set_verbose_help },
|
||||
{ { "show", "channel", NULL }, handle_showchan, "Display information on a specific channel", showchan_help, complete_ch },
|
||||
{ { "show", "channels", NULL }, handle_chanlist, "Display information on channels", chanlist_help },
|
||||
{ { "show", "channel", NULL }, handle_showchan, "Display information on a specific channel", showchan_help, complete_ch },
|
||||
{ { "show", "modules", NULL }, handle_modlist, "List modules and info", modlist_help },
|
||||
{ { "show", "uptime", NULL }, handle_showuptime, "Show uptime information", modlist_help },
|
||||
{ { "show", "version", NULL }, handle_version, "Display version info", version_help },
|
||||
@@ -948,7 +950,7 @@ static char *__ast_cli_generator(char *text, char *word, int state, int lock)
|
||||
fullcmd = fullcmd1;
|
||||
e1++;
|
||||
}
|
||||
if ((fullcmd[0] != '_') && !strncasecmp(matchstr, fullcmd, strlen(matchstr))) {
|
||||
if ((fullcmd[0] != '_') && !strncasecmp(text, fullcmd, strlen(text))) {
|
||||
/* We contain the first part of one or more commands */
|
||||
matchnum++;
|
||||
if (matchnum > state) {
|
||||
|
Reference in New Issue
Block a user