Index: trunk/ippTools/src/camtool.c
===================================================================
--- trunk/ippTools/src/camtool.c	(revision 23616)
+++ trunk/ippTools/src/camtool.c	(revision 23688)
@@ -468,5 +468,6 @@
 
     PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", 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);
 
     // generate restrictions
@@ -533,15 +534,15 @@
         zpt_lq,
         zpt_uq,
-	fwhm_major,
-	fwhm_major_lq,
-	fwhm_major_uq,
-	fwhm_minor,
-	fwhm_minor_lq,
-	fwhm_minor_uq,
-
-	iq_fwhm_major,
-	iq_fwhm_major_err,
-	iq_fwhm_minor,
-	iq_fwhm_minor_err,
+        fwhm_major,
+        fwhm_major_lq,
+        fwhm_major_uq,
+        fwhm_minor,
+        fwhm_minor_lq,
+        fwhm_minor_uq,
+
+        iq_fwhm_major,
+        iq_fwhm_major_err,
+        iq_fwhm_minor,
+        iq_fwhm_minor_err,
 
         iq_m2,
@@ -576,5 +577,6 @@
         n_astrom,
         path_base,
-        code
+        fault,
+        quality
         );
 
@@ -599,7 +601,7 @@
 
     // NULL for end_stage means go as far as possible
-    // EAM : skip here if code != 0
+    // EAM : skip here if fault != 0
     // Also, we can run fake even if tess_id is not defined
-    if (code || (pendingRow->end_stage && psStrcasestr(pendingRow->end_stage, "cam"))) {
+    if (fault || (pendingRow->end_stage && psStrcasestr(pendingRow->end_stage, "cam"))) {
         psFree(row);
         psFree(pendingRow);
@@ -745,5 +747,5 @@
     PXOPT_COPY_STR(config->args, where, "-label",     "camRun.label",          "==");
     PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction",      "==");
-    PXOPT_COPY_S16(config->args, where, "-code",      "camProcessedExp.fault", "==");
+    PXOPT_COPY_S16(config->args, where, "-fault", "camProcessedExp.fault", "==");
 
     if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) {
@@ -833,5 +835,5 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
-    PXOPT_LOOKUP_S16(code, config->args, "-code", true, false);
+    PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false);
 
     psMetadata *where = psMetadataAlloc();
@@ -841,5 +843,5 @@
     PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "==");
 
-    if (!pxSetFaultCode(config->dbh, "camProcessedExp", where, code)) {
+    if (!pxSetFaultCode(config->dbh, "camProcessedExp", where, fault)) {
         psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
         psFree (where);
@@ -1114,5 +1116,5 @@
     char sqlFilename[80];
   } ExportTable;
-  
+
   int numExportTables = 2;
 
@@ -1194,5 +1196,5 @@
 
   PS_ASSERT_PTR_NON_NULL(config, NULL);
-  
+
   PXOPT_LOOKUP_STR(infile, config->args, "-infile", true,  false);
 
@@ -1205,5 +1207,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);
@@ -1214,5 +1216,5 @@
   // fprintf (stdout, "---- cam run ----\n");
   // psMetadataPrint (stderr, entry->data.md, 1);
-  
+
   item = psMetadataLookup (input, "camProcessedImfile");
   psAssert (item, "entry not in input?");
