Index: trunk/ippTools/src/regtool.c
===================================================================
--- trunk/ippTools/src/regtool.c	(revision 23544)
+++ trunk/ippTools/src/regtool.c	(revision 23688)
@@ -238,5 +238,7 @@
     PXOPT_LOOKUP_TIME(dateobs, config->args, "-dateobs", false, false);
     PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false);
-    PXOPT_LOOKUP_S16(code, config->args, "-code", false, false);
+
+    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
+    PXOPT_LOOKUP_S16(quality, config->args, "-quality", false, false);
 
     if (!rawImfileInsert(
@@ -302,5 +304,6 @@
         ignored,
         hostname,
-        code,
+        fault,
+        quality,
         NULL,
         0
@@ -408,5 +411,5 @@
     PXOPT_COPY_STR(config->args, where,  "-tmp_class_id", "tmp_class_id", "==");
     PXOPT_COPY_STR(config->args, where,  "-class_id",     "class_id", "==");
-    PXOPT_COPY_S16(config->args, where,  "-code",         "fault", "==");
+    PXOPT_COPY_S16(config->args, where,  "-fault",         "fault", "==");
     PXOPT_COPY_S64(config->args, where,  "-exp_id_begin", "exp_id", ">=");
     PXOPT_COPY_S64(config->args, where,  "-exp_id_end", "exp_id", "<=");
@@ -452,13 +455,13 @@
     PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false);
 
-    PXOPT_LOOKUP_S16(code, config->args, "-code", false, false);
+    PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false);
     PXOPT_LOOKUP_F64(user_1, config->args, "-user_1", false, false);
 
-    if ((code == INT16_MAX) && !isfinite(user_1)) { 
-        psError(PS_ERR_UNKNOWN, false, "one of -code or -user_1 must be selected");
-        return false;
-    }
-    if ((code != INT16_MAX) && isfinite(user_1)) { 
-        psError(PS_ERR_UNKNOWN, false, "only one of -code or -user_1 must be selected");
+    if ((fault == INT16_MAX) && !isfinite(user_1)) { 
+        psError(PS_ERR_UNKNOWN, false, "one of -fault or -user_1 must be selected");
+        return false;
+    }
+    if ((fault != INT16_MAX) && isfinite(user_1)) { 
+        psError(PS_ERR_UNKNOWN, false, "only one of -fault or -user_1 must be selected");
         return false;
     }
@@ -468,7 +471,7 @@
     PXOPT_COPY_STR(config->args, where,  "-class_id",     "class_id", "==");
 
-    if (code != INT16_MAX) {
+    if (fault != INT16_MAX) {
 	// this is fairly dangerous : can set all if the where is not set...
-	if (!pxSetFaultCode(config->dbh, "rawImfile", where, code)) {
+	if (!pxSetFaultCode(config->dbh, "rawImfile", where, fault)) {
 	    psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
 	    psFree (where);
@@ -644,5 +647,5 @@
 
     // default
-    PXOPT_LOOKUP_S16(code, config->args, "-code", false, false);
+    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
 
     psString query = pxDataGet("regtool_pendingexp.sql");
@@ -801,5 +804,5 @@
         moon_phase,
         hostname,
-        code,
+        fault,
         NULL,
         0
@@ -995,5 +998,5 @@
     psMetadata *where = psMetadataAlloc();
     PXOPT_COPY_S64(config->args, where,  "-exp_id",       "exp_id", "==");
-    PXOPT_COPY_S16(config->args, where,  "-code",         "fault", "==");
+    PXOPT_COPY_S16(config->args, where,  "-fault",         "fault", "==");
     PXOPT_COPY_S64(config->args, where,  "-exp_id_begin", "exp_id", ">=");
     PXOPT_COPY_S64(config->args, where,  "-exp_id_end", "exp_id", "<=");
@@ -1039,7 +1042,7 @@
     PXOPT_COPY_S64(config->args, where,  "-exp_id",       "exp_id", "==");
 
-    PXOPT_LOOKUP_S16(code, config->args, "-code", true, false);
-
-    if (!pxSetFaultCode(config->dbh, "rawExp", where, code)) {
+    PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false);
+
+    if (!pxSetFaultCode(config->dbh, "rawExp", where, fault)) {
         psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
         psFree(where);
@@ -1161,5 +1164,5 @@
     char sqlFilename[80];
   } ExportTable;
-  
+
   int numExportTables = 2;
 
@@ -1241,5 +1244,5 @@
 
   PS_ASSERT_PTR_NON_NULL(config, NULL);
-  
+
   PXOPT_LOOKUP_STR(infile, config->args, "-infile", true,  false);
 
@@ -1252,5 +1255,5 @@
   psAssert (item, "entry not in input?");
   psAssert (item->type == PS_DATA_METADATA_MULTI, "entry not multi?");
-  
+
   psMetadataItem *entry = psListGet (item->data.list, 0);
   assert (entry);
