Index: trunk/ippTools/src/dettool.c
===================================================================
--- trunk/ippTools/src/dettool.c	(revision 7373)
+++ trunk/ippTools/src/dettool.c	(revision 7378)
@@ -1625,4 +1625,46 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
+    // det_id & iteration are 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;
+    }
+    psString iteration = psMetadataLookupStr(&status, config->args, "-iteration");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration");
+        return false;
+    }
+    if (!iteration) {
+        psError(PS_ERR_UNKNOWN, true, "-iteration is required");
+        return false;
+    }
+    // comment is optional
+    psString comment = psMetadataLookupStr(&status, config->args, "-comment");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -comment");
+        return false;
+    }
+
+    // create a new detMasterFrame row and insert it
+    detMasterFrameRow *masterFrame = detMasterFrameRowAlloc(
+                (psS32)atol(det_id),
+                (psS32)atol(iteration),
+                comment // may be NULL
+            );
+
+    if (!detMasterFrameInsertObject(config->dbh, masterFrame)) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        psFree(masterFrame);
+        return false;
+    }
+
+    psFree(masterFrame);
+
     return true;
 }
@@ -1632,4 +1674,32 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
+    // no options are required... use the default where statement
+    psArray *masterFrames= detMasterFrameSelectRowObjects(config->dbh,
+            config->where, 0);
+    if (!masterFrames) {
+        psError(PS_ERR_UNKNOWN, false, "no detMasterFrame rows found");
+        return false;
+    }
+
+    if (psArrayLength(masterFrames)) {
+        // print imfile list
+        psMetadata *output = psMetadataAlloc();
+        for (long i = 0; i < psArrayLength(masterFrames); i++) {
+            psMetadata *md = detMasterFrameMetadataFromObject(
+                    masterFrames->data[i]);
+            psMetadataAddMetadata(
+                output, PS_LIST_TAIL, "detMasterFrame",
+                PS_META_DUPLICATE_OK, NULL, md
+            );
+        }
+
+        psString str = psMetadataConfigFormat(output); 
+        psFree(output);
+        fprintf(stdout, "%s\n", str);
+        psFree(str);
+    }
+
+    psFree(masterFrames);
+
     return true;
 }
