[asterisk-commits] eliel: branch group/data_api_gsoc2009 r211561 - /team/group/data_api_gsoc2009...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 10 14:28:11 CDT 2009


Author: eliel
Date: Mon Aug 10 14:28:08 2009
New Revision: 211561

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=211561
Log:
Allow to get every part of the tree from the test CLI command.


Modified:
    team/group/data_api_gsoc2009/tests/test_data.c

Modified: team/group/data_api_gsoc2009/tests/test_data.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/tests/test_data.c?view=diff&rev=211561&r1=211560&r2=211561
==============================================================================
--- team/group/data_api_gsoc2009/tests/test_data.c (original)
+++ team/group/data_api_gsoc2009/tests/test_data.c Mon Aug 10 14:28:08 2009
@@ -257,27 +257,28 @@
 	FILE *outfile;
 	struct ast_data_query query = {
 		.version = AST_DATA_QUERY_VERSION,
-		.path = "asterisk/application/app_voicemail/voicemail"
 	};
 
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "data test get dump";
-		e->usage = "Usage: data test get dump <output-filename>\n"
+		e->usage = "Usage: data test get dump <path> <output-filename>\n"
 			   "   Dump ast_data test to a file in XML format.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc != e->args + 1) {
+	if (a->argc != e->args + 2) {
 		return CLI_SHOWUSAGE;
 	}
+
+	query.path = (char *) a->argv[e->args];
 
 	/* and now get it in xml form. */
 	doc = ast_data_get_xml(&query);
 	if (doc) {
-		outfile = fopen(a->argv[e->args], "w+");
+		outfile = fopen(a->argv[e->args + 1], "w+");
 		if (outfile) {
 			ast_xml_doc_dump_file(outfile, doc);
 		} else {




More information about the asterisk-commits mailing list