← Back to team overview

mvhub-dev team mailing list archive

[Merge] lp:~leegoodrich/mvhub/fix_notification_email_execute into lp:mvhub

 

Lee Goodrich has proposed merging lp:~leegoodrich/mvhub/fix_notification_email_execute into lp:mvhub.

Requested reviews:
  MVHub devs with commit rights (mvhub-commit)


Simple change to get the execute option working. GetOptions can only be 
called once to parse option data, and was failing when called twice to 
parse different things.
-- 
https://code.launchpad.net/~leegoodrich/mvhub/fix_notification_email_execute/+merge/24601
Your team MVHub Developers is subscribed to branch lp:mvhub.
=== modified file 'app-mvhub/bin/notification_email.pl'
--- app-mvhub/bin/notification_email.pl	2010-04-16 14:20:33 +0000
+++ app-mvhub/bin/notification_email.pl	2010-05-03 19:09:17 +0000
@@ -33,11 +33,14 @@
     shift_off_notifications_with_reminder_count
     /;
 
-# Config File Variables
+# Command Line option handling
 my $cfg_filename = $ENV{MV_CONFIG_FILE};
-Getopt::Long::GetOptions( 'config=s' => \$cfg_filename )
+my $execute = 0;
+Getopt::Long::GetOptions( 'config=s' => \$cfg_filename,
+						  'execute' => \$execute )
     or die "GetOptions failed";
 
+# Config File Variables
 my $CFG = MVHub::Utils::ConfigSimple::create_config_from($cfg_filename);
 
 my $MAX_NOTIFICATIONS = $CFG->param('NOTIFICATION.max_notifications');
@@ -60,10 +63,6 @@
     = "$TEMPLATE_PATH/reminder_email_05.tmpl";
 
 {    # Main
-    my $execute = 0;
-    Getopt::Long::GetOptions( 'execute' => \$execute )
-        or die "GetOptions failed";
-
     my @date = Date::Calc::Add_Delta_YM( Date::Calc::Today(), 0,
         -($EXPIRE_MONTHS) );
     my $expire_date = join '-', @date;


Follow ups