diff -Nru mime-construct-1.10/debian/changelog mime-construct-1.11/debian/changelog --- mime-construct-1.10/debian/changelog 2009-11-20 01:17:23.000000000 +0000 +++ mime-construct-1.11/debian/changelog 2010-06-23 19:07:38.000000000 +0100 @@ -1,3 +1,9 @@ +mime-construct (1.11) unstable; urgency=low + + * Add --body and --attach aliases. + + -- Roderick Schertler Wed, 23 Jun 2010 14:04:40 -0400 + mime-construct (1.10) unstable; urgency=low * Escape /^From / as "=46rom " in quoted-printable to prevent an MTA @@ -44,4 +50,4 @@ -- Roderick Schertler Sat, 3 Apr 1999 00:11:48 -0500 -$Id: changelog,v 1.7 2009-11-20 01:17:23 roderick Exp $ +$Id: changelog,v 1.8 2010-06-23 18:07:38 roderick Exp $ diff -Nru mime-construct-1.10/debian/TODO mime-construct-1.11/debian/TODO --- mime-construct-1.10/debian/TODO 1970-01-01 01:00:00.000000000 +0100 +++ mime-construct-1.11/debian/TODO 2010-06-23 19:07:47.000000000 +0100 @@ -0,0 +1,3 @@ +$Id: TODO,v 1.1 2010-06-23 18:07:47 roderick Exp $ + +- support for character encoding in headers diff -Nru mime-construct-1.10/mime-construct mime-construct-1.11/mime-construct --- mime-construct-1.10/mime-construct 2009-11-20 01:17:20.000000000 +0000 +++ mime-construct-1.11/mime-construct 2010-06-23 19:07:36.000000000 +0100 @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; -# $Id: mime-construct,v 1.12 2009-11-20 01:17:20 roderick Exp $ +# $Id: mime-construct,v 1.13 2010-06-23 18:07:36 roderick Exp $ # # Roderick Schertler @@ -29,7 +29,7 @@ (my $Me = $0) =~ s-.*/--; my # new line required for makemaker - $VERSION = '1.10'; + $VERSION = '1.11'; my $Debug = 0; my $Exit = 0; @@ -66,7 +66,9 @@ --file-auto path same, but also set the Content-Type from the path's extention (requires MIME::Types) --file-attach path same, but also set --attachment to the file's base name + --attach path synonym for --file-attach --string str output a part whose contents are str + --body str synonym for --string Subpart output switches: --subpart-file path @@ -126,6 +128,11 @@ unrepresentable unthinkable ventricles whitehall ); +my %Switch_synonym = ( + '--attach' => '--file-attach', + '--body' => '--string', +); + sub xwarndie_mess { my @mess = ("$Me: ", @_); $mess[$#mess] =~ s/:(?!\n)$/: $!\n/; @@ -322,6 +329,10 @@ while (@args) { $switch = shift @args; + if (defined(my $s = $Switch_synonym{$switch})) { + $switch = $s; + } + $switch =~ /^-/ or usage "invalid arg (non-switch) $switch\n"; # switches which don't take args @@ -761,8 +772,12 @@ =item B<--file-attach> I +=item B<--attach> I + =item B<--string> I +=item B<--body> I + Use the contents of the file I or the literal string I as the body of this part. @@ -777,6 +792,9 @@ has an artificial limitation which prevents it from being able to encode such a data stream). +B<--attach> is an alias for B<--file-attach>, and B<--body> is an alias +for B<--string>. + =item B<--subpart-file> I =item B<--subpart-string> I