Index: trunk/ippTools/src/vptool.c
===================================================================
--- trunk/ippTools/src/vptool.c	(revision 32748)
+++ trunk/ippTools/src/vptool.c	(revision 32750)
@@ -282,5 +282,4 @@
     psFree(where);
 
-    psStringAppend(&query, "\nGROUP BY vp_id HAVING");
     psStringAppend(&query, "\nORDER BY priority DESC, vp_id");
 
@@ -597,34 +596,16 @@
 static bool processedcellMode(pxConfig *config)
 {
-return false;
-#ifdef notyet
     PS_ASSERT_PTR_NON_NULL(config, NULL);
 
     PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
-    PXOPT_LOOKUP_BOOL(faulted, config->args, "-faulted", false);
-    PXOPT_LOOKUP_BOOL(allfiles, config->args, "-allfiles", false);
-    if (allfiles) {
-        faulted = false;
-    }
-    PXOPT_LOOKUP_BOOL(pstamp_order, config->args, "-pstamp_order", false);
 
     psMetadata *where = psMetadataAlloc();
     pxchipGetSearchArgs (config, where); // chipRun, chipProcessedImfile, rawExp
-    PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "==");
-    PXOPT_COPY_S64(config->args, where, "-chip_imfile_id", "chipImfile.chip_imfile_id", "==");
-    PXOPT_COPY_STR(config->args, where, "-class_id", "chipProcessedImfile.class_id", "==");
-    PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "==");
-    pxAddLabelSearchArgs (config, where, "-label", "chipRun.label", "LIKE");
-    pxAddLabelSearchArgs (config, where, "-data_group", "chipRun.data_group", "LIKE");
-    PXOPT_COPY_S64(config->args, where, "-magicked", "chipProcessedImfile.magicked", "==");
-
-    psString where2 = NULL;
-    pxmagicAddWhere(config, &where2, "chipProcessedImfile");
-    // add cuts on ra and decl if supplied
-    if (!pxspaceAddWhere(config, &where2, "rawExp")) {
-        psError(psErrorCodeLast(), false, "pxSpaceAddWhere failed");
-        return false;
-    }
+    PXOPT_COPY_S64(config->args, where, "-vp_id", "vp_id", "==");
+    PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "==");
+    PXOPT_COPY_STR(config->args, where, "-cell_id", "cell_id", "==");
+    pxAddLabelSearchArgs (config, where, "-label", "vpRun.label", "LIKE");
+    pxAddLabelSearchArgs (config, where, "-data_group", "vpRun.data_group", "LIKE");
 
     psString query = pxDataGet("vptool_processedcell.sql");
@@ -636,30 +617,13 @@
     if (psListLength(where->list)) {
         psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
-        psStringAppend(&query, " WHERE %s %s", whereClause, where2 ? where2 : "");
+        psStringAppend(&query, " WHERE %s", whereClause);
         psFree(whereClause);
-    } else if (psMetadataLookupBool(NULL, config->args, "-all") || (faulted || where2)) {
-        psStringAppend(&query, " WHERE chipRun.chip_id IS NOT NULL %s", where2 ? where2 : "");
     } else {
         psFree(where);
-        psError(PXTOOLS_ERR_CONFIG, false, "search parameters (or -all) are required");
+        psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required");
         return false;
     }
     psFree(where);
 
-    if (faulted) {
-        // list only faulted rows
-        psStringAppend(&query, " %s", "AND chipProcessedImfile.fault != 0");
-    } else if (!allfiles) {
-        // don't list faulted rows
-        psStringAppend(&query, " %s", "AND chipProcessedImfile.fault = 0");
-    }
-
-    if (pstamp_order) {
-        // put runs in order of exposure id with newest chip Runs first
-        // The postage stamp parser depends on this behavior
-        psStringAppend(&query, "\nORDER by exp_id, chip_id DESC");
-    }
-
-    // treat limit == 0 as "no limit"
     if (limit) {
         psString limitString = psDBGenerateLimitSQL(limit);
@@ -687,5 +651,5 @@
 
     // negative simple so the default is true
-    if (!ippdbPrintMetadatas(stdout, output, "chipProcessedImfile", !simple)) {
+    if (!ippdbPrintMetadatas(stdout, output, "vpProcessedCell", !simple)) {
         psError(PS_ERR_UNKNOWN, false, "failed to print array");
         psFree(output);
@@ -696,5 +660,4 @@
 
     return true;
-#endif
 }
 
