use strict;
my $P = $0;
-my $V = '0.15';
+my $V = '0.16';
use Getopt::Long qw(:config no_auto_abbrev);
}
my @email_to = ();
+my @list_to = ();
my @scm = ();
my @web = ();
my @subsystem = ();
my $exclude = 0;
foreach my $line (@typevalue) {
- if ($line =~ m/^(\C):(.*)/) {
+ if ($line =~ m/^(\C):\s*(.*)/) {
my $type = $1;
my $value = $2;
if ($type eq 'X') {
if (!$exclude) {
my $tvi = 0;
foreach my $line (@typevalue) {
- if ($line =~ m/^(\C):(.*)/) {
+ if ($line =~ m/^(\C):\s*(.*)/) {
my $type = $1;
my $value = $2;
if ($type eq 'F') {
}
}
-if ($email) {
- my $address_cnt = @email_to;
- if ($address_cnt == 0 && $email_list) {
- push(@email_to, "linux-kernel\@vger.kernel.org");
+if ($email || $email_list) {
+ my @to = ();
+ if ($email) {
+ @to = (@to, @email_to);
}
-
-#Don't sort email address list, but do remove duplicates
- @email_to = uniq(@email_to);
- output(@email_to);
+ if ($email_list) {
+ if (@list_to == 0) {
+ push(@list_to, "linux-kernel\@vger.kernel.org");
+ @to = (@to, @list_to);
+ }
+ }
+ output(uniq(@to));
}
if ($scm) {
--multiline => print 1 entry per line
Default options:
- [--email --git --m --l --multiline]
+ [--email --git --m --n --l --multiline]
Other options:
--version -> show version
$index = $index - 1;
while ($index >= 0) {
my $tv = $typevalue[$index];
- if ($tv =~ m/^(\C):(.*)/) {
+ if ($tv =~ m/^(\C):\s*(.*)/) {
my $ptype = $1;
my $pvalue = $2;
if ($ptype eq "L") {
- my $subscr = $pvalue;
- if ($subscr =~ m/\s*\(subscribers-only\)/) {
+ my $list_address = $pvalue;
+ my $list_additional = "";
+ if ($list_address =~ m/([^\s]+)\s+(.*)$/) {
+ $list_address = $1;
+ $list_additional = $2;
+ }
+ if ($list_additional =~ m/\(subscribers-only\)/) {
if ($email_subscriber_list) {
- $subscr =~ s/\s*\(subscribers-only\)//g;
- push(@email_to, $subscr);
+ push(@list_to, $list_address);
}
} else {
if ($email_list) {
- push(@email_to, $pvalue);
+ push(@list_to, $list_address);
}
}
} elsif ($ptype eq "M") {
if ($email_maintainer) {
if ($index >= 0) {
my $tv = $typevalue[$index - 1];
- if ($tv =~ m/^(\C):(.*)/) {
+ if ($tv =~ m/^(\C):\s*(.*)/) {
if ($1 eq "P" && $email_usename) {
push(@email_to, format_email($2, $pvalue));
} else {