9163bbc2e39ec26d12c8a90bb26e365792f60670 ceisenhart Sun Jan 11 17:15:33 2015 -0800 Added a 'data last updated' tag to table display after 'Row Count' and before 'Format description' diff --git src/hg/hgTables/schema.c src/hg/hgTables/schema.c index 7d4a03a..d29797a 100644 --- src/hg/hgTables/schema.c +++ src/hg/hgTables/schema.c @@ -18,31 +18,30 @@ #include "trackDb.h" #include "joiner.h" #include "tableDescriptions.h" #include "asParse.h" #include "customTrack.h" #include "bedCart.h" #include "hgMaf.h" #include "hgTables.h" #include "wikiTrack.h" #include "makeItemsItem.h" #include "bedDetail.h" #include "pgSnp.h" #include "hubConnect.h" #include "errCatch.h" - static char *nbForNothing(char *val) /* substitute   for empty strings to keep table formating sane */ { char *s = skipLeadingSpaces(val); if ((s == NULL) || (s[0] == '\0')) return " "; else return val; } static char *abbreviateInPlace(char *val, int len) /* Abbreviate a string to len characters. */ { int vlen = strlen(val); if (vlen > len) @@ -371,31 +370,33 @@ if (tdbForConn == NULL) conn = hAllocConn(db); else conn = hAllocConnTrack(db, tdbForConn); struct joiner *joiner = allJoiner; struct joinerPair *jpList, *jp; struct asObject *asObj = asForTable(conn, table); char *splitTable = chromTable(conn, table); hPrintf("Database: %s", db); hPrintf("    Primary Table: %s", table); if (!sameString(splitTable, table)) hPrintf(" (%s)", splitTable); hPrintf("    Row Count: "); printLongWithCommas(stdout, sqlTableSize(conn, splitTable)); -hPrintf("
\n"); +char *date = firstWordInLine(sqlTableUpdate(conn, table)); +if (date != NULL) + printf("   Data last updated: %s
\n", date); if (asObj != NULL) hPrintf("Format description: %s
", asObj->comment); describeFields(db, splitTable, asObj, conn); if (tdbForConn != NULL) { char *type = tdbForConn->type; if (startsWithWord("bigWig", type)) printf("
This table simply points to a file in " "" "BigWig format.
\n"); } jpList = joinerRelate(joiner, db, table); /* sort and unique list */ slUniqify(&jpList, joinerPairCmpOnAandB, joinerPairFree);