Index: trunk/ippTools/src/pubtool.c
===================================================================
--- trunk/ippTools/src/pubtool.c	(revision 28319)
+++ trunk/ippTools/src/pubtool.c	(revision 28320)
@@ -165,4 +165,7 @@
 
     PXOPT_LOOKUP_BOOL(rerun, config->args, "-rerun", false);
+    PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false);
+    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
+    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
 
     psString query = pxDataGet("pubtool_definerun.sql"); // Query to run
@@ -174,5 +177,11 @@
 
     if (!rerun) {
-        psStringAppend(&query, "WHERE publishRun.client_id IS NULL");
+        psStringAppend(&query, "\nWHERE publishRun.client_id IS NULL");
+    }
+
+    if (limit) {
+        psString limitString = psDBGenerateLimitSQL(limit);
+        psStringAppend(&query, "\n%s", limitString);
+        psFree(limitString);
     }
 
@@ -213,4 +222,14 @@
     if (!psArrayLength(output)) {
         psTrace("pubtool", PS_LOG_INFO, "No rows found");
+        psFree(output);
+        return true;
+    }
+
+    if (pretend) {
+        if (!ippdbPrintMetadatas(stdout, output, "publishRun", !simple)) {
+            psError(psErrorCodeLast(), false, "Failed to print array");
+            psFree(output);
+            return false;
+        }
         psFree(output);
         return true;
