Index: /trunk/ippScripts/scripts/ipp_serial_inject.pl
===================================================================
--- /trunk/ippScripts/scripts/ipp_serial_inject.pl	(revision 16639)
+++ /trunk/ippScripts/scripts/ipp_serial_inject.pl	(revision 16640)
@@ -24,12 +24,16 @@
 
 # Parse the command-line arguments
-my ($workdir, $dbname, $telescope, $camera, $reduction, $help);
-GetOptions(
-    'workdir|w=s'    => \$workdir, # working directory for output files
-    'dbname|d=s'     => \$dbname, # Database name
-    'telescope|t=s'  => \$telescope, # user-supplied telescope name
-    'camera|i=s'     => \$camera, # user-supplied camera name
-    'reduction=s'    => \$reduction, # user-supplied camera name
-    'help'           => \$help # give help listing
+my ($camera, $telescope, $workdir, $reduction, $dvo_db, $tess_id, $end_stage, $label, $dbname, $no_op, $help);
+GetOptions('camera|i=s'     => \$camera,    # user-supplied camera name
+	   'telescope|t=s'  => \$telescope, # user-supplied telescope name
+	   'workdir|w=s'    => \$workdir,   # working directory for output files
+	   'reduction=s'    => \$reduction, # user-supplied camera name
+	   'dvodb=s'        => \$dvo_db,    # target dvo database 
+	   'tess_id=s'      => \$tess_id,   # tessalation for warping
+	   'end_stage=s'    => \$end_stage, # stop processing at this step
+	   'label=s'        => \$label,     # set chip label
+	   'dbname|d=s'     => \$dbname,    # Database name
+	   'no-op'          => \$no_op,     # pretend but don't actually inject
+	   'help'           => \$help       # give help listing
 ) or pod2usage( 2 );
 
@@ -38,5 +42,5 @@
     defined $help;
 
-pod2usage( -msg => "Usage: $0 --telescope (name) --camera (name) [--workdir path] [--dbname dbname] (files)", 
+pod2usage( -msg => "Usage: $0 --telescope (name) --camera (name) [--workdir path] [--reduction class] [--dvodb db] [--tess_id tess] [--end_stage stage] [--label label] [--dbname dbname] (files)", 
 	   -exitval => 2 ) if 
     scalar @ARGV == 0;
@@ -86,13 +90,22 @@
     $command_exp .= " -tmp_telescope $telescope";
     $command_exp .= " -workdir $workdir";
-    $command_exp .= " -dbname $dbname" if defined $dbname;
     $command_exp .= " -reduction $reduction" if defined $reduction;
+    $command_exp .= " -dvo_db $dvo_db"       if defined $dvo_db;
+    $command_exp .= " -tess_id $tess_id"     if defined $tess_id;
+    $command_exp .= " -end_stage $end_stage" if defined $end_stage;
+    $command_exp .= " -label $label"         if defined $label;
+    $command_exp .= " -dbname $dbname"       if defined $dbname;
 
-    my ( $success_exp, $error_code_exp, $full_buf_exp, $stdout_buf_exp, $stderr_buf_exp ) =
-	run( command => $command_exp, verbose => 1 );
-    die "Unable to inject $exp_name: $error_code_exp\n" if not $success_exp;
-    
-    my @line = split(/\s+/, $$stdout_buf_exp[0]); # The output line, containing the exposure tag
-    my $exp_id = $line[2];	# The exposure tag
+    my $exp_id = 0;
+    unless ($no_op) {
+	my ( $success_exp, $error_code_exp, $full_buf_exp, $stdout_buf_exp, $stderr_buf_exp ) =
+	    run( command => $command_exp, verbose => 1 );
+	die "Unable to inject $exp_name: $error_code_exp\n" if not $success_exp;
+	
+	my @line = split(/\s+/, $$stdout_buf_exp[0]); # The output line, containing the exposure tag
+	$exp_id = $line[2];	# The exposure tag
+    } else {
+	print "skipping command: $command_exp\n";
+    }
     
     # the class_id used here is temporary : register replaces it with the true class_id
@@ -103,6 +116,10 @@
     $command_imfile .= " -dbname $dbname" if defined ($dbname);
     
-    my ( $success_imfile, $error_code_imfile, $full_buf_imfile, $stdout_buf_imfile, $stderr_buf_imfile ) = run( command => $command_imfile, verbose => 1 );
-    die "Unable to inject $exp_name imfile: $error_code_imfile\n" if not $success_imfile;
+    unless ($no_op) {
+	my ( $success_imfile, $error_code_imfile, $full_buf_imfile, $stdout_buf_imfile, $stderr_buf_imfile ) = run( command => $command_imfile, verbose => 1 );
+	die "Unable to inject $exp_name imfile: $error_code_imfile\n" if not $success_imfile;
+    } else {
+	print "skipping command: $command_imfile\n";
+    }
 
     # the class_id used here is temporary : register replaces it with the true class_id
@@ -112,6 +129,10 @@
     $command_update .= " -dbname $dbname" if defined ($dbname);
     
-    my ( $success_update, $error_code_update, $full_buf_update, $stdout_buf_update, $stderr_buf_update ) = run( command => $command_update, verbose => 1 );
-    die "Unable to update $exp_name: $error_code_update\n" if not $success_update;
+    unless ($no_op) {
+	my ( $success_update, $error_code_update, $full_buf_update, $stdout_buf_update, $stderr_buf_update ) = run( command => $command_update, verbose => 1 );
+	die "Unable to update $exp_name: $error_code_update\n" if not $success_update;
+    } else {
+	print "skipping command: $command_update\n";
+    }
 
     return 1;
