Index: trunk/ippTools/src/regtoolConfig.c
===================================================================
--- trunk/ippTools/src/regtoolConfig.c	(revision 14098)
+++ trunk/ippTools/src/regtoolConfig.c	(revision 14099)
@@ -306,17 +306,4 @@
 }
 
-#define addWhereS16(name) \
-{ \
-    psS16 s16 = 0; \
-    bool status = false; \
-    if ((s16= psMetadataLookupS16(&status, config->args, "-" #name))) { \
-        if (!psMetadataAddS16(config->where, PS_LIST_TAIL, #name, 0, "==", s16)) { \
-            psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \
-            psFree(config); \
-            return NULL; \
-        } \
-    } \
-}
-
     // generate SQL where clause
     config->where = psMetadataAlloc();
@@ -335,4 +322,5 @@
         }
     }
+
     addWhereStr(telescope);
     addWhereStr(exp_type);
@@ -341,5 +329,17 @@
     addWhereStr(tmp_class_id);
     addWhereStr(filter);
-    addWhereS16(code);
+
+    // convert '-code' to 'fault'
+    {
+        psS16 fault = 0;
+        bool status = false;
+        if ((fault = psMetadataLookupS16(&status, config->args, "-code"))) {
+            if (!psMetadataAddS16(config->where, PS_LIST_TAIL, "fault", 0, "==", fault)) {
+                psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
+                psFree(config);
+                return NULL;
+            }
+        }
+    }
 
     if (config->where->list->n < 1) {
