Index: trunk/ippTools/src/dettool.c
===================================================================
--- trunk/ippTools/src/dettool.c	(revision 7422)
+++ trunk/ippTools/src/dettool.c	(revision 7423)
@@ -17,6 +17,4 @@
 static bool addstacMode(pxConfig *config);
 static bool stacMode(pxConfig *config);
-static psArray *validDetInputClassIds(pxConfig *config, const char *det_id);
-static psArray *searchInputImfiles(pxConfig *config, const char *det_id);
 static bool stacframeMode(pxConfig *config);
 static bool addnormalizedMode(pxConfig *config);
@@ -30,5 +28,8 @@
 static bool masterframeMode(pxConfig *config);
 static bool masterMode(pxConfig *config);
-
+static bool rerunMode(pxConfig *config);
+
+static psArray *validDetInputClassIds(pxConfig *config, const char *det_id);
+static psArray *searchInputImfiles(pxConfig *config, const char *det_id);
 static detInputExpRow *rawDetrenTodetInputExpRow(rawDetrendExpRow *rawExp, psS32 det_id, psS32 iteration);
 static psArray *searchRawImfiles(pxConfig *config, psMetadata *where);
@@ -65,4 +66,5 @@
         MODECASE(DETTOOL_MODE_MASTERFRAME, masterframeMode);
         MODECASE(DETTOOL_MODE_MASTER, masterMode);
+        MODECASE(DETTOOL_MODE_RERUN, rerunMode);
         default:
             psAbort(argv[0], "invalid option (this should not happen)");
@@ -1772,2 +1774,22 @@
     return true;
 }
+
+
+static bool rerunMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+ 
+    // det_id is required
+    bool status = false;
+    psString det_id = psMetadataLookupStr(&status, config->args, "-det_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_id");
+        return false;
+    }
+    if (!det_id) {
+        psError(PS_ERR_UNKNOWN, true, "-det_id is required");
+        return false;
+    }
+
+    return true;
+}
