[asterisk-commits] mvanbaak: branch group/cli_cleanup r145006 - in /team/group/cli_cleanup: apps...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Sep 27 16:40:40 CDT 2008


Author: mvanbaak
Date: Sat Sep 27 16:40:40 2008
New Revision: 145006

URL: http://svn.digium.com/view/asterisk?view=rev&rev=145006
Log:
change few cli commands to be consitent
like decided at the cli crew at astridevcon


Modified:
    team/group/cli_cleanup/apps/app_mixmonitor.c
    team/group/cli_cleanup/apps/app_queue.c
    team/group/cli_cleanup/channels/chan_features.c
    team/group/cli_cleanup/channels/chan_h323.c
    team/group/cli_cleanup/main/manager.c
    team/group/cli_cleanup/res/res_agi.c

Modified: team/group/cli_cleanup/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/group/cli_cleanup/apps/app_mixmonitor.c?view=diff&rev=145006&r1=145005&r2=145006
==============================================================================
--- team/group/cli_cleanup/apps/app_mixmonitor.c (original)
+++ team/group/cli_cleanup/apps/app_mixmonitor.c Sat Sep 27 16:40:40 2008
@@ -365,7 +365,7 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "mixmonitor [start|stop]";
+		e->command = "mixmonitor {start|stop} {chan_name} [args]";
 		e->usage =
 			"Usage: mixmonitor <start|stop> <chan_name> [args]\n"
 			"       The optional arguments are passed to the MixMonitor\n"

Modified: team/group/cli_cleanup/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/group/cli_cleanup/apps/app_queue.c?view=diff&rev=145006&r1=145005&r2=145006
==============================================================================
--- team/group/cli_cleanup/apps/app_queue.c (original)
+++ team/group/cli_cleanup/apps/app_queue.c Sat Sep 27 16:40:40 2008
@@ -6264,9 +6264,9 @@
 	struct penalty_rule *pr_iter;
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "queue rules show";
+		e->command = "queue show rules";
 		e->usage =
-		"Usage: queue rules show [rulename]\n"
+		"Usage: queue show rules [rulename]\n"
 		"Show the list of rules associated with rulename. If no\n"
 		"rulename is specified, list all rules defined in queuerules.conf\n";
 		return NULL;
@@ -6295,9 +6295,9 @@
 {
 	switch (cmd) {
 		case CLI_INIT:
-			e->command = "queue rules reload";
+			e->command = "queue reload rules";
 			e->usage = 
-				"Usage: queue rules reload\n"
+				"Usage: queue reload rules\n"
 				"Reloads rules defined in queuerules.conf\n";
 			return NULL;
 		case CLI_GENERATE:

Modified: team/group/cli_cleanup/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/team/group/cli_cleanup/channels/chan_features.c?view=diff&rev=145006&r1=145005&r2=145006
==============================================================================
--- team/group/cli_cleanup/channels/chan_features.c (original)
+++ team/group/cli_cleanup/channels/chan_features.c Sat Sep 27 16:40:40 2008
@@ -501,9 +501,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "feature show channels";
+		e->command = "features show channels";
 		e->usage =
-			"Usage: feature show channels\n"
+			"Usage: features show channels\n"
 			"       Provides summary information on feature channels.\n";
 		return NULL;
 	case CLI_GENERATE:

Modified: team/group/cli_cleanup/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/group/cli_cleanup/channels/chan_h323.c?view=diff&rev=145006&r1=145005&r2=145006
==============================================================================
--- team/group/cli_cleanup/channels/chan_h323.c (original)
+++ team/group/cli_cleanup/channels/chan_h323.c Sat Sep 27 16:40:40 2008
@@ -2619,16 +2619,16 @@
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "h323 set trace [off]";
+		e->command = "h323 set trace [on|off]";
 		e->usage =
-			"Usage: h323 set trace (off|<trace level>)\n"
+			"Usage: h323 set trace (on|off|<trace level>)\n"
 			"       Enable/Disable H.323 stack tracing for debugging purposes\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc != 4)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 	if (!strcasecmp(a->argv[3], "off")) {
 		h323_debug(0, 0);
@@ -2645,21 +2645,21 @@
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "h323 set debug [off]";
+		e->command = "h323 set debug [on|off]";
 		e->usage =
-			"Usage: h323 set debug [off]\n"
+			"Usage: h323 set debug [on|off]\n"
 			"       Enable/Disable H.323 debugging output\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc < 3 || a->argc > 4)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
-	if (a->argc == 4 && strcasecmp(a->argv[3], "off"))
+	if (strcasecmp(a->argv[3], "on") && strcasecmp(a->argv[3], "off"))
 		return CLI_SHOWUSAGE;
 
-	h323debug = (a->argc == 3) ? 1 : 0;
+	h323debug = (strcasecmp(a->argv[3], "on")) ? 0 : 1;
 	ast_cli(a->fd, "H.323 Debugging %s\n", h323debug ? "Enabled" : "Disabled");
 	return CLI_SUCCESS;
 }

Modified: team/group/cli_cleanup/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/group/cli_cleanup/main/manager.c?view=diff&rev=145006&r1=145005&r2=145006
==============================================================================
--- team/group/cli_cleanup/main/manager.c (original)
+++ team/group/cli_cleanup/main/manager.c Sat Sep 27 16:40:40 2008
@@ -519,18 +519,18 @@
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "manager debug [on|off]";
-		e->usage = "Usage: manager debug [on|off]\n	Show, enable, disable debugging of the manager code.\n";
+		e->command = "manager set debug [on|off]";
+		e->usage = "Usage: manager set debug [on|off]\n	Show, enable, disable debugging of the manager code.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;	
 	}
-	if (a->argc == 2)
+	if (a->argc == 3)
 		ast_cli(a->fd, "manager debug is %s\n", manager_debug? "on" : "off");
-	else if (a->argc == 3) {
-		if (!strcasecmp(a->argv[2], "on"))
+	else if (a->argc == 4) {
+		if (!strcasecmp(a->argv[3], "on"))
 			manager_debug = 1;
-		else if (!strcasecmp(a->argv[2], "off"))
+		else if (!strcasecmp(a->argv[3], "off"))
 			manager_debug = 0;
 		else
 			return CLI_SHOWUSAGE;

Modified: team/group/cli_cleanup/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/team/group/cli_cleanup/res/res_agi.c?view=diff&rev=145006&r1=145005&r2=145006
==============================================================================
--- team/group/cli_cleanup/res/res_agi.c (original)
+++ team/group/cli_cleanup/res/res_agi.c Sat Sep 27 16:40:40 2008
@@ -86,7 +86,7 @@
 "AGISIGHUP channel variable to \"no\" before executing the AGI application.\n"
 "  Using 'EAGI' provides enhanced AGI, with incoming audio available out of band\n"
 "on file descriptor 3.\n\n"
-"  Use the CLI command 'agi show' to list available agi commands.\n"
+"  Use the CLI command 'agi show commnands' to list available agi commands.\n"
 "  This application sets the following channel variable upon completion:\n"
 "     AGISTATUS      The status of the attempt to the run the AGI script\n"
 "                    text string, one of SUCCESS | FAILURE | NOTFOUND | HANGUP\n";
@@ -2727,9 +2727,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "agi show";
+		e->command = "agi show commands [topic]";
 		e->usage =
-			"Usage: agi show [topic]\n"
+			"Usage: agi show commands [topic]\n"
 			"       When called with a topic as an argument, displays usage\n"
 			"       information on the given command.  If called without a\n"
 			"       topic, it provides a list of AGI commands.\n";




More information about the asterisk-commits mailing list