parse-options: move unsigned long option parsing out of pack-objects.c
[gitweb.git] / git-send-email.perl
index a18a7959ed81e9385b490e475bb87bd6875eb0e1..6bedf745e72d3935f7feaae2cfca95d44a3e6df5 100755 (executable)
@@ -516,6 +516,31 @@ sub split_addrs {
                          }
                      } },
 
+       sendmail => sub { my $fh = shift; while (<$fh>) {
+               # ignore blank lines and comment lines
+               if (/^\s*(?:#.*)?$/) { }
+
+               # warn on lines that contain quotes
+               elsif (/"/) {
+                       print STDERR "sendmail alias with quotes is not supported: $_\n";
+               }
+
+               # warn on lines that continue
+               elsif (/^\s|\\$/) {
+                       print STDERR "sendmail continuation line is not supported: $_\n";
+               }
+
+               # recognize lines that look like an alias
+               elsif (/^(\S+?)\s*:\s*(.+)$/) {
+                       my ($alias, $addr) = ($1, $2);
+                       $aliases{$alias} = [ split_addrs($addr) ];
+               }
+
+               # warn on lines that are not recognized
+               else {
+                       print STDERR "sendmail line is not recognized: $_\n";
+               }}},
+
        gnus => sub { my $fh = shift; while (<$fh>) {
                if (/\(define-mail-alias\s+"(\S+?)"\s+"(\S+?)"\)/) {
                        $aliases{$1} = [ $2 ];
@@ -762,6 +787,7 @@ sub file_declares_8bit_cte {
                print "    $f\n";
        }
        $auto_8bit_encoding = ask("Which 8bit encoding should I declare [UTF-8]? ",
+                                 valid_re => qr/.{4}/, confirm_only => 1,
                                  default => "UTF-8");
 }