src/hg/utils/tdbQuery/tdbQuery.c 1.16

1.16 2009/12/05 02:45:48 kent
Adding -noBlank option
Index: src/hg/utils/tdbQuery/tdbQuery.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/utils/tdbQuery/tdbQuery.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -b -B -U 4 -r1.15 -r1.16
--- src/hg/utils/tdbQuery/tdbQuery.c	5 Dec 2009 02:32:49 -0000	1.15
+++ src/hg/utils/tdbQuery/tdbQuery.c	5 Dec 2009 02:45:48 -0000	1.16
@@ -17,8 +17,9 @@
 static char *clRoot = "~/kent/src/hg/makeDb/trackDb";	/* Root dir of trackDb system. */
 static boolean clCheck = FALSE;		/* If set perform lots of checks on input. */
 static boolean clStrict = FALSE;	/* If set only return tracks with actual tables. */
 static boolean clAlpha = FALSE;		/* If set include release alphas, exclude release beta. */
+static boolean clNoBlank = FALSE;	/* If set suppress blank lines in output. */
 
 void usage()
 /* Explain usage and exit. */
 {
@@ -48,9 +49,11 @@
 "there's problems.\n"
 "   -strict\n"
 "Mimic -strict option on hgTrackDb. Suppresses tracks where corresponding table does not exist.\n"
 "   -alpha\n"
-"Do checking on release alpha (and not release beta) tracks"
+"Do checking on release alpha (and not release beta) tracks\n"
+"   -noBlank\n"
+"Don't print out blank lines separating records"
 );
 }
 
 
@@ -58,8 +61,9 @@
    {"root", OPTION_STRING},
    {"check", OPTION_BOOLEAN},
    {"strict", OPTION_BOOLEAN},
    {"alpha", OPTION_BOOLEAN},
+   {"noBlank", OPTION_BOOLEAN},
    {NULL, 0},
 };
 
 #define glKeyField "track"	 /* The field that has the record ID */
@@ -837,9 +841,10 @@
 	if (match)
 	    fprintf(out, "%s %s\n", r->name, r->val);
 	}
     }
-fprintf(out, "\n");
+if (!clNoBlank)
+    fprintf(out, "\n");
 }
 
 
 static boolean tableExistsInSelfOrOffspring(char *db, struct tdbRecord *record, 
@@ -976,7 +981,8 @@
 clRoot = simplifyPathToDir(optionVal("root", clRoot));
 clCheck = optionExists("check");
 clStrict = optionExists("strict");
 clAlpha = optionExists("alpha");
+clNoBlank = optionExists("noBlank");
 tdbQuery(argv[1]);
 return 0;
 }