Index: trunk/ippTools/src/chiptool.c
===================================================================
--- trunk/ippTools/src/chiptool.c	(revision 23657)
+++ trunk/ippTools/src/chiptool.c	(revision 23688)
@@ -409,14 +409,15 @@
     PXOPT_LOOKUP_F32(dtime_script, config->args,   "-dtime_script", false, false);
     PXOPT_LOOKUP_STR(hostname, config->args,       "-hostname", false, false);
-    PXOPT_LOOKUP_F32(n_stars, config->args,    	   "-n_stars", false, false);
-    PXOPT_LOOKUP_F32(n_psfstars, config->args,	   "-n_psfstars", false, false);
-    PXOPT_LOOKUP_F32(n_iqstars, config->args, 	   "-n_iqstars", false, false);
-    PXOPT_LOOKUP_F32(n_extended, config->args, 	   "-n_extended", false, false);
-    PXOPT_LOOKUP_F32(n_cr, config->args,       	   "-n_cr", false, false);
-    PXOPT_LOOKUP_STR(path_base, config->args,  	   "-path_base", false, false);
-    PXOPT_LOOKUP_BOOL(magicked, config->args,  	   "-magicked", false);
+    PXOPT_LOOKUP_F32(n_stars, config->args,        "-n_stars", false, false);
+    PXOPT_LOOKUP_F32(n_psfstars, config->args,     "-n_psfstars", false, false);
+    PXOPT_LOOKUP_F32(n_iqstars, config->args,      "-n_iqstars", false, false);
+    PXOPT_LOOKUP_F32(n_extended, config->args,     "-n_extended", false, false);
+    PXOPT_LOOKUP_F32(n_cr, config->args,           "-n_cr", false, false);
+    PXOPT_LOOKUP_STR(path_base, config->args,      "-path_base", false, false);
+    PXOPT_LOOKUP_BOOL(magicked, config->args,      "-magicked", false);
 
     // default values
-    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 (!psDBTransaction(config->dbh)) {
@@ -449,33 +450,33 @@
                                    fwhm_minor_uq,
 
-				   iq_fwhm_major,
-				   iq_fwhm_major_err,
-				   iq_fwhm_minor,
-				   iq_fwhm_minor_err,
-
-				   iq_m2,
-				   iq_m2_err,
-				   iq_m2_lq,
-				   iq_m2_uq,
-
-				   iq_m2c,
-				   iq_m2c_err,
-				   iq_m2c_lq,
-				   iq_m2c_uq,
-
-				   iq_m2s,
-				   iq_m2s_err,
-				   iq_m2s_lq,
-				   iq_m2s_uq,
-
-				   iq_m3,
-				   iq_m3_err,
-				   iq_m3_lq,
-				   iq_m3_uq,
-
-				   iq_m4,
-				   iq_m4_err,
-				   iq_m4_lq,
-				   iq_m4_uq,
+                                   iq_fwhm_major,
+                                   iq_fwhm_major_err,
+                                   iq_fwhm_minor,
+                                   iq_fwhm_minor_err,
+
+                                   iq_m2,
+                                   iq_m2_err,
+                                   iq_m2_lq,
+                                   iq_m2_uq,
+
+                                   iq_m2c,
+                                   iq_m2c_err,
+                                   iq_m2c_lq,
+                                   iq_m2c_uq,
+
+                                   iq_m2s,
+                                   iq_m2s_err,
+                                   iq_m2s_lq,
+                                   iq_m2s_uq,
+
+                                   iq_m3,
+                                   iq_m3_err,
+                                   iq_m3_lq,
+                                   iq_m3_uq,
+
+                                   iq_m4,
+                                   iq_m4_err,
+                                   iq_m4_lq,
+                                   iq_m4_uq,
 
                                    dtime_detrend,
@@ -490,5 +491,6 @@
                                    n_cr,
                                    path_base,
-                                   code,
+                                   fault,
+                                   quality,
                                    magicked
             )) {
@@ -618,5 +620,5 @@
     PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "LIKE");
     PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "==");
-    PXOPT_COPY_S16(config->args, where, "-code", "chipProcessedImfile.fault", "==");
+    PXOPT_COPY_S16(config->args, where, "-fault", "chipProcessedImfile.fault", "==");
 
     if (!psListLength(where->list)
@@ -659,7 +661,7 @@
     PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
     PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "==");
-    PXOPT_LOOKUP_S16(code, config->args, "-code", true, false);
-
-    if (!pxSetFaultCode(config->dbh, "chipProcessedImfile", where, code)) {
+    PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false);
+
+    if (!pxSetFaultCode(config->dbh, "chipProcessedImfile", where, fault)) {
         psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
         return false;
@@ -1280,5 +1282,5 @@
     char sqlFilename[80];
   } ExportTable;
-  
+
   int numExportTables = 3;
 
@@ -1360,11 +1362,11 @@
 {
   unsigned int nFail;
-  
+
   int numImportTables = 2;
- 
+
   char tables[2] [80] = {"chipImfile", "chipProcessedImfile"};
 
   PS_ASSERT_PTR_NON_NULL(config, NULL);
-  
+
   PXOPT_LOOKUP_STR(infile, config->args, "-infile", true,  false);
 
@@ -1386,10 +1388,10 @@
   // fprintf (stdout, "---- chip run ----\n");
   // psMetadataPrint (stderr, entry->data.md, 1);
-  
+
   for (int i = 0; i < numImportTables; i++) {
     psMetadataItem *item = psMetadataLookup (input, tables[i]);
     psAssert (item, "entry not in input?");
     psAssert (item->type == PS_DATA_METADATA_MULTI, "entry not multi?");
-  
+
     switch (i) {
       case 0:
@@ -1405,5 +1407,5 @@
         }
         break;
-        
+
       case 1:
         for (int i = 0; i < item->data.list->n; i++) {
