Index: branches/eam_branches/ipp-20110505/ippTools/src/addtool.c
===================================================================
--- branches/eam_branches/ipp-20110505/ippTools/src/addtool.c	(revision 31587)
+++ branches/eam_branches/ipp-20110505/ippTools/src/addtool.c	(revision 31628)
@@ -117,5 +117,5 @@
 
     psMetadata *where = psMetadataAlloc();
-    pxcamGetSearchArgs (config, where);
+    //  pxcamGetSearchArgs (config, where);
     PXOPT_COPY_S64(config->args, where,  "-cam_id",    "camRun.cam_id", "==");
     PXOPT_COPY_S64(config->args, where,  "-stack_id",    "stackRun.stack_id", "==");
@@ -123,7 +123,8 @@
     PXOPT_LOOKUP_STR(stage,       config->args, "-stage", false, false);
     if (strcmp(stage, "cam")== 0) {
-
+      pxcamGetSearchArgs (config, where);
     pxAddLabelSearchArgs (config, where, "-label",     "camRun.label", "=="); // define using camRun label
     pxAddLabelSearchArgs (config, where, "-data_group","camRun.data_group", "=="); // define using camRun label
+
     PXOPT_COPY_STR(config->args, where,  "-reduction", "camRun.reduction", "==");
     }
@@ -133,4 +134,5 @@
     pxAddLabelSearchArgs (config, where, "-data_group","stackRun.data_group", "=="); // define using camRun label
     PXOPT_COPY_STR(config->args, where,  "-reduction", "stackRun.reduction", "==");
+    pxAddLabelSearchArgs (config, where, "-filter",     "stackRun.filter", "=="); // define using camRun label
     }
     if (strcmp(stage, "staticsky")== 0) {
@@ -139,4 +141,5 @@
     pxAddLabelSearchArgs (config, where, "-data_group","staticskyRun.data_group", "=="); // define using camRun label
     PXOPT_COPY_STR(config->args, where,  "-reduction", "staticskyyRun.reduction", "==");
+    pxAddLabelSearchArgs (config, where, "-filter",     "stackRun.filter", "=="); // define using camRun label
     }
     
Index: branches/eam_branches/ipp-20110505/ippTools/src/addtoolConfig.c
===================================================================
--- branches/eam_branches/ipp-20110505/ippTools/src/addtoolConfig.c	(revision 31587)
+++ branches/eam_branches/ipp-20110505/ippTools/src/addtoolConfig.c	(revision 31628)
@@ -56,4 +56,5 @@
     psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by camRun label", NULL);
     psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by camRun data_group", NULL);
+    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-filter", PS_META_DUPLICATE_OK, "search by filter", NULL);
     psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-reduction",          0, "search by camRun reduction class", NULL);
     psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-destreaked",           0, "only queue destreaked runs", false);
Index: branches/eam_branches/ipp-20110505/ippTools/src/magictool.c
===================================================================
--- branches/eam_branches/ipp-20110505/ippTools/src/magictool.c	(revision 31587)
+++ branches/eam_branches/ipp-20110505/ippTools/src/magictool.c	(revision 31628)
@@ -404,5 +404,6 @@
     PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false);
     PXOPT_LOOKUP_BOOL(clearfault, config->args, "-clearfault", false);
-
+    PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
+    
     psString setString = NULL;
     if (fault || clearfault) {
@@ -411,4 +412,7 @@
     if (note) {
         psStringAppend(&setString, ", note = '%s'", note);
+    }
+    if (label) {
+        psStringAppend(&setString, ", label = '%s'", label);
     }
 
Index: branches/eam_branches/ipp-20110505/ippTools/src/magictoolConfig.c
===================================================================
--- branches/eam_branches/ipp-20110505/ippTools/src/magictoolConfig.c	(revision 31587)
+++ branches/eam_branches/ipp-20110505/ippTools/src/magictoolConfig.c	(revision 31628)
@@ -81,4 +81,5 @@
     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_state", 0, "set state (required)", NULL);
     psMetadataAddS16(updaterunArgs, PS_LIST_TAIL, "-set_fault", 0, "set fault code", 0);
+    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_label", 0, "define label", 0);
     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_note",  0, "define note", NULL);
     psMetadataAddBool(updaterunArgs, PS_LIST_TAIL, "-clearfault",  0, "set fault to zero", NULL);
