Index: trunk/ippTools/src/pstamptool.c
===================================================================
--- trunk/ippTools/src/pstamptool.c	(revision 27795)
+++ trunk/ippTools/src/pstamptool.c	(revision 27856)
@@ -302,4 +302,6 @@
     psFree(where);
 
+    psStringAppend(&query, " ORDER BY priority DESC, req_id");
+
     // treat limit == 0 as "no limit"
     if (limit) {
@@ -421,4 +423,6 @@
     }
     psFree(where);
+
+    psStringAppend(&query, " ORDER BY priority DESC, req_id");
 
     // treat limit == 0 as "no limit"
@@ -705,5 +709,5 @@
     PXOPT_COPY_S64(config->args, where, "-job_id", "job_id", "==");
     PXOPT_COPY_S64(config->args, where, "-req_id", "req_id", "==");
-    pxAddLabelSearchArgs(config, where, "-label", "label", "LIKE");
+    pxAddLabelSearchArgs(config, where, "-label", "pstampRequest.label", "LIKE");
 
     PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
@@ -723,4 +727,6 @@
     }
     psFree(where);
+
+    psStringAppend(&query, " ORDER BY priority DESC, req_id");
 
     // treat limit == 0 as "no limit"
@@ -968,4 +974,5 @@
     PXOPT_LOOKUP_STR(imagedb,     config->args, "-imagedb",  true, false);
     PXOPT_LOOKUP_STR(rlabel,      config->args, "-rlabel",  true, false);
+    PXOPT_LOOKUP_STR(outdir,      config->args, "-outdir",  true, false);
     PXOPT_LOOKUP_BOOL(need_magic, config->args, "-need_magic", false);
     PXOPT_LOOKUP_BOOL(no_create,  config->args, "-no_create", false);
@@ -1046,4 +1053,5 @@
         rlabel,
         need_magic,
+        outdir,
         0               // fault
         )) {
@@ -1087,4 +1095,5 @@
     PXOPT_COPY_STR(config->args, where, "-imagedb", "imagedb", "==");
     PXOPT_COPY_S64(config->args, where, "-stage_id", "stage_id", "==");
+    PXOPT_COPY_S64(config->args, where, "-dep_id", "dep_id", "==");
     PXOPT_COPY_STR(config->args, where, "-rlabel", "rlabel", "==");
     pxAddLabelSearchArgs(config, where, "-label", "pstampRequest.label", "==");
@@ -1105,4 +1114,6 @@
     }
     psFree(where);
+
+    psStringAppend(&query, " ORDER BY priority DESC, req_id");
 
     // treat limit == 0 as "no limit"
