[Asterisk-code-review] cli: Auto-complete File not Module for core set debug. (asterisk[11])

Alexander Traud asteriskteam at digium.com
Tue Oct 18 03:34:45 CDT 2016


Alexander Traud has uploaded a new change for review. ( https://gerrit.asterisk.org/4138 )

Change subject: cli: Auto-complete File not Module for core set debug.
......................................................................

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
---
M main/cli.c
1 file changed, 1 insertion(+), 13 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/38/4138/1

diff --git a/main/cli.c b/main/cli.c
index 2d14d40..3a07735 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -418,19 +418,11 @@
 	case CLI_INIT:
 		e->command = "core set debug";
 		e->usage =
-#if !defined(LOW_MEMORY)
 			"Usage: core set debug [atleast] <level> [module]\n"
-#else
-			"Usage: core set debug [atleast] <level>\n"
-#endif
 			"       core set debug off\n"
 			"\n"
-#if !defined(LOW_MEMORY)
 			"       Sets level of debug messages to be displayed or\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"
 			"       Equivalent to -d[d[...]] on startup\n";
 		return NULL;
@@ -458,13 +450,9 @@
 			} else if (a->n == (22 - numbermatch) && a->pos == 3 && ast_strlen_zero(argv3)) {
 				return ast_strdup("atleast");
 			}
-#if !defined(LOW_MEMORY)
 		} else if ((a->pos == 4 && !atleast && strcasecmp(argv3, "off") && strcasecmp(argv3, "channel"))
 			|| (a->pos == 5 && atleast)) {
-			const char *pos = S_OR(a->argv[a->pos], "");
-
-			return ast_complete_source_filename(pos, a->n);
-#endif
+			return ast_module_helper(a->line, a->word, a->pos, a->n, a->pos, 0);
 		}
 		return NULL;
 	}

-- 
To view, visit https://gerrit.asterisk.org/4138
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1213f1dd409bd4ff8de08ad80cb0c73cafb1bae0
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>



More information about the asterisk-code-review mailing list