Unverified Commit e77435d0 authored by IKEDA Soji's avatar IKEDA Soji Committed by GitHub
Browse files

Merge pull request #1010 from ikedas/issue-1008 by ikedas

sympa_newaliases.pl: Removing ineffective command line options
parents 3ff0bc15 01febc12
...@@ -45,12 +45,7 @@ unless (-t) { ...@@ -45,12 +45,7 @@ unless (-t) {
} }
my %options; my %options;
unless ( unless (GetOptions(\%options, 'domain=s', 'help|h', 'version|v')) {
GetOptions(
\%options, 'config|f=s', 'debug|d', 'domain=s',
'help|h', 'log_level=s', 'version|v'
)
) {
pod2usage(-exitval => 1, -output => \*STDERR); pod2usage(-exitval => 1, -output => \*STDERR);
} }
if ($options{'help'}) { if ($options{'help'}) {
...@@ -59,14 +54,9 @@ if ($options{'help'}) { ...@@ -59,14 +54,9 @@ if ($options{'help'}) {
printf "Sympa %s\n", Sympa::Constants::VERSION; printf "Sympa %s\n", Sympa::Constants::VERSION;
exit 0; exit 0;
} }
$Conf::sympa_config = $main::options{config};
if ($main::options{'debug'}) {
$main::options{'log_level'} = 2 unless $main::options{'log_level'};
}
my $log = Sympa::Log->instance; my $log = Sympa::Log->instance;
$log->{log_to_stderr} = 'all' if $main::options{'debug'} or -t; $log->{log_to_stderr} = 'all' if -t;
my $robot_id = $options{'domain'}; my $robot_id = $options{'domain'};
...@@ -84,11 +74,7 @@ $log->openlog( ...@@ -84,11 +74,7 @@ $log->openlog(
); );
# setting log_level using conf unless it is set by calling option # setting log_level using conf unless it is set by calling option
if (defined $main::options{'log_level'}) { $log->{level} = $Conf::Conf{'log_level'};
$log->{level} = $main::options{'log_level'};
} else {
$log->{level} = $Conf::Conf{'log_level'};
}
my ($aliases_file, $aliases_program, $aliases_db_type); my ($aliases_file, $aliases_program, $aliases_db_type);
if ($robot_id) { if ($robot_id) {
...@@ -194,11 +180,6 @@ F<sympa_newaliases.pl> may run with following options. ...@@ -194,11 +180,6 @@ F<sympa_newaliases.pl> may run with following options.
Name of virtual robot on which aliases will be updated. Name of virtual robot on which aliases will be updated.
=item C<-f>, C<--config=>I<file>
Force sympa_newaliases to use an alternative configuration file instead
of F<--CONFIG-->.
=item C<-h>, C<--help> =item C<-h>, C<--help>
Print this help message. Print this help message.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment