diff options
-rwxr-xr-x | scripts/generate_bmo_data.pl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/generate_bmo_data.pl b/scripts/generate_bmo_data.pl index fefeb06d6..788227443 100755 --- a/scripts/generate_bmo_data.pl +++ b/scripts/generate_bmo_data.pl @@ -22,6 +22,7 @@ use Bugzilla::Keyword; use Bugzilla::Config qw(:admin); use Bugzilla::User::Setting; use Bugzilla::Status; +use Getopt::Long qw( :config gnu_getopt ); BEGIN { Bugzilla->extensions } @@ -30,9 +31,6 @@ my $dbh = Bugzilla->dbh; # set Bugzilla usage mode to USAGE_MODE_CMDLINE Bugzilla->usage_mode(USAGE_MODE_CMDLINE); -my $admin_email = shift || 'admin@mozilla.bugs'; -Bugzilla->set_user(Bugzilla::User->check({ name => $admin_email })); - ########################################################################## # Set Default User Preferences ########################################################################## @@ -65,6 +63,11 @@ my %user_prefs = ( zoom_textareas => 'off', ); +GetOptions('user-pref=s%' => \%user_prefs); + +my $admin_email = shift || 'admin@mozilla.bugs'; +Bugzilla->set_user(Bugzilla::User->check({ name => $admin_email })); + foreach my $pref (keys %user_prefs) { my $value = $user_prefs{$pref}; Bugzilla::User::Setting::set_default($pref, $value, 1); |