Index: /branches/end_stage/ippTools/src/pztool.c
===================================================================
--- /branches/end_stage/ippTools/src/pztool.c	(revision 16146)
+++ /branches/end_stage/ippTools/src/pztool.c	(revision 16147)
@@ -443,4 +443,16 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
+    // XXX this is an ugly hack!
+    // we are passing exp level info to a imfile level mode (-copydone)
+    // these options are thrown away unless we just -copydone'd the last imfile
+    // in an exp.  
+    // This function MUST NOT be invoked from anywhere but copydoneMode().
+ 
+    // optional
+    PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", false, false);
+    PXOPT_LOOKUP_STR(dvodb, config->args, "-dvodb", false, false);
+    PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", false, false);
+    PXOPT_LOOKUP_STR(end_stage, config->args, "-end_stage", false, false);
+
     // find all exposures that have had all of their imfiles downloaded but do
     // not appear in newExp
@@ -488,10 +500,10 @@
                     doneExp->telescope, // tmp_telescope
                     "run",              // state
-                    NULL,               // workdir
+                    workdir,            // workdir
                     "dirty",            // workdir state
                     NULL,               // reduction class
-                    NULL,               // dvodb
-                    NULL,               // tess_id
-                    NULL                // end_stage
+                    dvodb,              // dvodb
+                    tess_id,            // tess_id
+                    end_stage           // end_stage
                 )
         ) {
