Index: trunk/ippScripts/scripts/phase0exp.pl
===================================================================
--- trunk/ippScripts/scripts/phase0exp.pl	(revision 8715)
+++ trunk/ippScripts/scripts/phase0exp.pl	(revision 9091)
@@ -10,4 +10,20 @@
 use Data::Dumper;
 
+use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
+
+my ($expid, $no_update);
+
+GetOptions(
+    'exp_id|e=s'    => \$expid,
+    'no-update'     => \$no_update
+) or pod2usage( 2 );
+
+pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
+pod2usage(
+    -msg => "Required options: --exp_id",
+    -exitval => 3,
+) unless defined $expid;
+
+# Define setup
 use constant TYPE => "exp_type"; # Observation type keyword
 use constant DETRENDS => [ "bias", "dark", "flat", "fringe" ]; # Observation types to mark as detrend
@@ -42,10 +58,4 @@
 ###                           "time" # Time of exposure --- not yet implemented
                            ];
-
-if (scalar @ARGV == 0 || scalar @ARGV >= 2) {
-    die "Perform phase 0 processing at the exposure level.\n\n" .
-        "Usage: $0 EXP_ID\n\n";
-}
-my $expid = shift @ARGV;        # Exposure id
 
 
@@ -106,5 +116,5 @@
 
 # Output results to the database
-{
+unless ($no_update) {
     my $command = "$p0tool -updateexp -exp_id $expid"; # Command to execute to update exposure parameters
     
