Index: /trunk/ippTasks/camera.pro
===================================================================
--- /trunk/ippTasks/camera.pro	(revision 12696)
+++ /trunk/ippTasks/camera.pro	(revision 12697)
@@ -122,5 +122,4 @@
     book getword camPendingExp $pageName workdir -var WORKDIR
     book getword camPendingExp $pageName dbname -var DBNAME
-    set_standard_args
 
     # specify choice of remote host:(need to choose based on chips)
@@ -143,8 +142,9 @@
     exec mkdir -p $outroot
 
-    $run = camera_exp.pl --exp_id $EXP_ID --cam_id $CAM_ID --camera $CAMERA $ARGS
+    $run = camera_exp.pl --exp_id $EXP_ID --cam_id $CAM_ID --camera $CAMERA
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
Index: /trunk/ippTasks/chip.pro
===================================================================
--- /trunk/ippTasks/chip.pro	(revision 12696)
+++ /trunk/ippTasks/chip.pro	(revision 12697)
@@ -124,5 +124,4 @@
     book getword chipPendingImfile $pageName uri -var URI
     book getword chipPendingImfile $pageName dbname -var DBNAME
-    set_standard_args
 
     # specify choice of remote host
@@ -146,8 +145,9 @@
     exec mkdir -p $outroot
 
-    $run = chip_imfile.pl --exp_id $EXP_ID --chip_id $CHIP_ID --class_id $CLASS_ID --uri $URI --camera $CAMERA $ARGS
+    $run = chip_imfile.pl --exp_id $EXP_ID --chip_id $CHIP_ID --class_id $CLASS_ID --uri $URI --camera $CAMERA
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
Index: /trunk/ippTasks/detrend.norm.pro
===================================================================
--- /trunk/ippTasks/detrend.norm.pro	(revision 12696)
+++ /trunk/ippTasks/detrend.norm.pro	(revision 12697)
@@ -155,5 +155,4 @@
     book getword detPendingNormStatImfile $pageName workdir   -var WORKDIR
     book getword detPendingNormStatImfile $pageName dbname    -var DBNAME
-    set_standard_args
 
     # specify choice of remote host:
@@ -175,8 +174,9 @@
     exec mkdir -p $outroot
 
-    $run = detrend_norm_calc.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE $ARGS
+    $run = detrend_norm_calc.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
@@ -277,5 +277,4 @@
     book getword detPendingNormImfile $pageName workdir   -var WORKDIR
     book getword detPendingNormImfile $pageName dbname    -var DBNAME
-    set_standard_args
 
     # specify choice of remote host:
@@ -298,8 +297,9 @@
     exec mkdir -p $outroot
 
-    $run = detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE $ARGS
+    $run = detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
     
     # save the pageName for future reference below
@@ -397,5 +397,4 @@
     book getword detPendingNormExp $pageName workdir   -var WORKDIR
     book getword detPendingNormExp $pageName dbname    -var DBNAME
-    set_standard_args
 
     # specify choice of remote host:
@@ -418,8 +417,9 @@
     exec mkdir -p $outroot
 
-    $run = detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE  $ARGS
+    $run = detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE 
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
Index: /trunk/ippTasks/detrend.process.pro
===================================================================
--- /trunk/ippTasks/detrend.process.pro	(revision 12696)
+++ /trunk/ippTasks/detrend.process.pro	(revision 12697)
@@ -144,5 +144,4 @@
     book getword detPendingProcessedImfile $pageName workdir  -var WORKDIR
     book getword detPendingProcessedImfile $pageName dbname   -var DBNAME
-    set_standard_args
 
     # specify choice of remote host:
@@ -165,8 +164,9 @@
     exec mkdir -p $outroot
 
-    $run = detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class_id $CLASS_ID --input_uri $URI --camera $CAMERA $ARGS
+    $run = detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class_id $CLASS_ID --input_uri $URI --camera $CAMERA
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
@@ -266,5 +266,4 @@
     book getword detPendingProcessedExp $pageName workdir   -var WORKDIR
     book getword detPendingProcessedExp $pageName dbname    -var DBNAME
-    set_standard_args
 
     # specify choice of remote host:
@@ -287,8 +286,9 @@
     exec mkdir -p $outroot
 
-    $run = detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA $ARGS
+    $run = detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
Index: /trunk/ippTasks/detrend.reject.pro
===================================================================
--- /trunk/ippTasks/detrend.reject.pro	(revision 12696)
+++ /trunk/ippTasks/detrend.reject.pro	(revision 12697)
@@ -124,5 +124,4 @@
     book getword detRejectExp $pageName workdir   -var WORKDIR
     book getword detRejectExp $pageName dbname    -var DBNAME
-    set_standard_args
 
     # specify choice of remote host:
@@ -144,8 +143,9 @@
     exec mkdir -p $outroot
 
-    $run = detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA $ARGS
+    $run = detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
Index: /trunk/ippTasks/detrend.resid.pro
===================================================================
--- /trunk/ippTasks/detrend.resid.pro	(revision 12696)
+++ /trunk/ippTasks/detrend.resid.pro	(revision 12697)
@@ -144,5 +144,4 @@
     book getword detPendingResidImfile $pageName workdir   -var WORKDIR
     book getword detPendingResidImfile $pageName dbname    -var DBNAME
-    set_standard_args
 
     # specify choice of remote host:
@@ -165,8 +164,9 @@
     exec mkdir -p $outroot
 
-    $run = detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE $ARGS
+    $run = detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
@@ -267,5 +267,4 @@
     book getword detPendingResidExp $pageName workdir   -var WORKDIR
     book getword detPendingResidExp $pageName dbname    -var DBNAME
-    set_standard_args
 
     # specify choice of remote host:
@@ -288,8 +287,9 @@
     exec mkdir -p $outroot
 
-    $run = detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA $ARGS
+    $run = detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
Index: /trunk/ippTasks/detrend.stack.pro
===================================================================
--- /trunk/ippTasks/detrend.stack.pro	(revision 12696)
+++ /trunk/ippTasks/detrend.stack.pro	(revision 12697)
@@ -125,5 +125,4 @@
     book getword detPendingStackedImfile $pageName workdir   -var WORKDIR
     book getword detPendingStackedImfile $pageName dbname    -var DBNAME
-    set_standard_args
 
     # specify choice of remote host:
@@ -148,8 +147,9 @@
     options $pageName
 
-    $run = detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA $ARGS
+    $run = detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # create the command line
Index: /trunk/ippTasks/diff.pro
===================================================================
--- /trunk/ippTasks/diff.pro	(revision 12696)
+++ /trunk/ippTasks/diff.pro	(revision 12697)
@@ -130,5 +130,4 @@
     book getword diffSkyfile $pageName workdir -var WORKDIR
     book getword diffSkyfile $pageName dbname -var DBNAME
-    set_standard_args
 
     # specify choice of remote host
@@ -152,8 +151,9 @@
     exec mkdir -p $outroot
 
-    $run = diff_skycell.pl --diff_id $DIFF_ID $ARGS
+    $run = diff_skycell.pl --diff_id $DIFF_ID
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
Index: /trunk/ippTasks/pantasks.pro
===================================================================
--- /trunk/ippTasks/pantasks.pro	(revision 12696)
+++ /trunk/ippTasks/pantasks.pro	(revision 12697)
@@ -155,25 +155,22 @@
 end
 
-macro set_standard_args
-  # XXX be careful: $ARGS cannot be resolved as ""
-  # XXX currently, sprintf is the only good way of creating 
-  # an empty variable
-  if ($?WORKDIR == 0) 
-    echo error in pantasks: WORKDIR not set
+macro add_standard_args
+  if ($0 != 2)
+    echo "Must pass in the command of interest, and this function will supplement"
     stop
   end
-  if ($?DBNAME == 0) 
-    echo error in pantasks: DBNAME not set
-    stop
-  end
-  if ("$DBNAME" != "DEFAULT")
-    $ARGS = --workdir $WORKDIR --dbname $DBNAME
-  else
-    $ARGS = --workdir $WORKDIR
+
+  local command
+  $command = $$1
+
+  if ($?DBNAME && "$DBNAME" != "DEFAULT")
+    $command = $command --dbname $DBNAME
   end
   if ($?NOOP != 0)
-    $ARGS = $ARGS --no-op
-  end
-end
+    $command = $command --no-op
+  end
+  $$1 = $command
+end
+
 
 macro process_exit
Index: /trunk/ippTasks/register.pro
===================================================================
--- /trunk/ippTasks/register.pro	(revision 12696)
+++ /trunk/ippTasks/register.pro	(revision 12697)
@@ -142,5 +142,4 @@
     book getword regPendingImfile $pageName workdir -var WORKDIR
     book getword regPendingImfile $pageName dbname -var DBNAME
-    set_standard_args
 
     # specify choice of remote host
@@ -162,9 +161,12 @@
     options $pageName
 
+    $run = register_imfile.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI
+    add_standard_args run
+
     # create the command line
     if ($VERBOSE > 1)
-      echo command register_imfile.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI $ARGS
-    end
-    command register_imfile.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI $ARGS
+      echo command $run
+    end
+    command $run
   end
 
@@ -247,5 +249,4 @@
     book getword regPendingExp $pageName workdir -var WORKDIR
     book getword regPendingExp $pageName dbname -var DBNAME
-    set_standard_args
 
     # specify choice of remote host:(need to choose based on chips)
@@ -267,9 +268,12 @@
     options $pageName
 
+    $run = register_exp.pl --exp_tag $EXP_TAG
+    add_standard_args run
+
     # create the command line
     if ($VERBOSE > 1)
-      echo command register_exp.pl --exp_tag $EXP_TAG $ARGS
-    end
-    command register_exp.pl --exp_tag $EXP_TAG $ARGS
+      echo command $run
+    end
+    command $run
   end
 
Index: /trunk/ippTasks/stack.pro
===================================================================
--- /trunk/ippTasks/stack.pro	(revision 12696)
+++ /trunk/ippTasks/stack.pro	(revision 12697)
@@ -130,5 +130,4 @@
     book getword stackSumSkyfile $pageName workdir -var WORKDIR
     book getword stackSumSkyfile $pageName dbname -var DBNAME
-    set_standard_args
 
     # specify choice of remote host
@@ -152,8 +151,9 @@
     exec mkdir -p $outroot
 
-    $run = stack_skycell.pl --stack_id $STACK_ID $ARGS
+    $run = stack_skycell.pl --stack_id $STACK_ID
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
Index: /trunk/ippTasks/warp.pro
===================================================================
--- /trunk/ippTasks/warp.pro	(revision 12696)
+++ /trunk/ippTasks/warp.pro	(revision 12697)
@@ -147,5 +147,4 @@
     book getword warpInputExp $pageName workdir -var WORKDIR
     book getword warpInputExp $pageName dbname -var DBNAME
-    set_standard_args
 
     # specify choice of remote host
@@ -169,8 +168,9 @@
     exec mkdir -p $outroot
 
-    $run = warp_overlap.pl --warp_id $WARP_ID --camera $CAMERA $ARGS
+    $run = warp_overlap.pl --warp_id $WARP_ID --camera $CAMERA
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
@@ -270,5 +270,4 @@
     book getword warpPendingSkyCell $pageName workdir -var WORKDIR
     book getword warpPendingSkyCell $pageName dbname -var DBNAME
-    set_standard_args
 
     # specify choice of remote host
@@ -292,8 +291,9 @@
     exec mkdir -p $outroot
 
-    $run = warp_skycell.pl --warp_id $WARP_ID --skycell_id $SKYCELL_ID --tess_id $TESS_ID --camera $CAMERA $ARGS
+    $run = warp_skycell.pl --warp_id $WARP_ID --skycell_id $SKYCELL_ID --tess_id $TESS_ID --camera $CAMERA
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
     end
+    add_standard_args run
 
     # save the pageName for future reference below
