[darwinbuild-changes] [134] trunk/darwinxref/plugins/exportIndex.c

source_changes at macosforge.org source_changes at macosforge.org
Wed Oct 4 01:49:20 PDT 2006


Revision: 134
          http://trac.macosforge.org/projects/darwinbuild/changeset/134
Author:   kevin
Date:     2006-10-04 01:49:20 -0700 (Wed, 04 Oct 2006)

Log Message:
-----------
- added build as an optional argument to exportIndex

Modified Paths:
--------------
    trunk/darwinxref/plugins/exportIndex.c

Modified: trunk/darwinxref/plugins/exportIndex.c
===================================================================
--- trunk/darwinxref/plugins/exportIndex.c	2005-07-30 18:06:29 UTC (rev 133)
+++ trunk/darwinxref/plugins/exportIndex.c	2006-10-04 08:49:20 UTC (rev 134)
@@ -37,16 +37,22 @@
 static int run(CFArrayRef argv) {
 	int res = 0;
 	CFIndex count = CFArrayGetCount(argv);
-	if (count > 1)  return -1;
+	if (count > 2)  return -1;
 	int xml = 0;
-	if (count == 1) {
+	CFStringRef build = DBGetCurrentBuild();
+	if (count >= 1) {
 		CFStringRef arg = CFArrayGetValueAtIndex(argv, 0);
 		xml = CFEqual(arg, CFSTR("-xml"));
 		// -xml is the only supported option
-		if (!xml) return -1;
+		if (xml && count >= 2) {
+			build = CFArrayGetValueAtIndex(argv, 1);
+		} else if (count == 1) {
+			build = arg;
+		} else {
+			return -1;
+		}
 	}
 	
-	CFStringRef build = DBGetCurrentBuild();
 	CFPropertyListRef plist = DBCopyBuildPlist(build);
 	if (xml) {
 		CFDataRef data = CFPropertyListCreateXMLData(NULL, plist);
@@ -58,7 +64,7 @@
 }
 
 static CFStringRef usage() {
-	return CFRetain(CFSTR("[-xml]"));
+	return CFRetain(CFSTR("[-xml] [<build>]"));
 }
 
 int initialize(int version) {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20061004/25780bf6/attachment-0001.html


More information about the darwinbuild-changes mailing list