<<< Date Index >>>     <<< Thread Index >>>

Re: regression: attaching files from command line fails



* Tue Oct 28 2008 Vincent Lefevre <vincent@xxxxxxxxxx>
> On 2008-10-28 16:47:17 +0900, TAKAHASHI Tamotsu wrote:
> > Here is another patch, to adjust
> > documentation instead of implementation.
> 
> That's not quite correct. The "--" is needed only when there are
> other arguments. It is optional at the end, e.g.:
> 
>   mutt -a file1 file2

Thanks, it wasn't documented either, that you can omit
recipient addresses after -a. So I have to change
        [-a <file> [...]] [--] <addr> [...]
to
        [-a <file> [...] [-- <addr>] [<addr> [...]]
or
        [[-a <file> [...] [-- <addr> [...]] | [<addr> [...]]]
if I stick with this implementation.

I hope the real programmers discussing on this topic will
find a better way. ;)

-- 
tamo
diff -r 5ea9f336dd60 UPDATING
--- a/UPDATING  Mon Oct 20 11:50:38 2008 -0700
+++ b/UPDATING  Wed Oct 29 07:00:21 2008 +0900
@@ -12,6 +12,7 @@
     to an IMAP server before it must collect the responses
   + $ssl_client_cert available with gnutls as well as openssl
   + 'mime_lookup application/octet-stream' added to system Muttrc
+  ! option "-a" requires "--" before address(es) even for one single file
 
 1.5.18 (2008-05-17):
 
diff -r 5ea9f336dd60 doc/mutt.man
--- a/doc/mutt.man      Mon Oct 20 11:50:38 2008 -0700
+++ b/doc/mutt.man      Wed Oct 29 07:00:21 2008 +0900
@@ -35,9 +35,8 @@
 [-s \fIsubj\fP]
 [-b \fIaddr\fP]
 [-c \fIaddr\fP]
-[\-a \fIfile\fP [...]]
-[\-\-]
-\fIaddr\fP [...]
+[\-a \fIfile\fP [...] [\-\- \fIaddr\fP]]
+[\fIaddr\fP [...]]
 .PP
 .B mutt 
 [-nx] 
@@ -46,9 +45,8 @@
 [-s \fIsubj\fP]
 [-b \fIaddr\fP]
 [-c \fIaddr\fP]
-[\-a \fIfile\fP [...]]
-[\-\-]
-\fIaddr\fP [...]
+[\-a \fIfile\fP [...] [\-\- \fIaddr\fP]]
+[\fIaddr\fP [...]]
 < message
 .PP
 .B mutt
@@ -74,10 +72,10 @@
 .PP
 .IP "-A \fIalias\fP"
 An expanded version of the given alias is passed to stdout.
-.IP "-a \fIfile\fP [...]"
-Attach a file to your message using MIME.
-To attach multiple files, separating filenames and recipient addresses with
-"\-\-" is mandatory, e.g. \fBmutt \-a img.jpg *.png \-\- addr1 addr2\fP.
+.IP "-a \fIfile\fP [...] [--]"
+Attach files to your message using MIME.
+You have to separate filenames and recipient addresses with
+"\-\-", e.g. \fBmutt \-a img.jpg *.png \-\- addr1 addr2\fP.
 .IP "-b \fIaddress\fP"
 Specify a blind-carbon-copy (BCC) recipient
 .IP "-c \fIaddress\fP"
diff -r 5ea9f336dd60 main.c
--- a/main.c    Mon Oct 20 11:50:38 2008 -0700
+++ b/main.c    Wed Oct 29 07:00:21 2008 +0900
@@ -110,8 +110,8 @@
 
   puts _(
 "usage: mutt [<options>] [-z] [-f <file> | -yZ]\n\
-       mutt [<options>] [-x] [-Hi <file>] [-s <subj>] [-bc <addr>] [-a <file> 
[...]] [--] <addr> [...]\n\
-       mutt [<options>] [-x] [-s <subj>] [-bc <addr>] [-a <file> [...]] [--] 
<addr> [...] < message\n\
+       mutt [<options>] [-x] [-Hi <file>] [-s <subj>] [-bc <addr>] [-a <file> 
[...] [-- <addr>]] [<addr> [...]]\n\
+       mutt [<options>] [-x] [-s <subj>] [-bc <addr>] [-a <file> [...] [-- 
<addr>]] [<addr> [...]] < message\n\
        mutt [<options>] -p\n\
        mutt [<options>] -A <alias> [...]\n\
        mutt [<options>] -Q <query> [...]\n\
@@ -121,7 +121,7 @@
   puts _("\
 options:\n\
   -A <alias>\texpand the given alias\n\
-  -a <file>\tattach a file to the message\n\
+  -a <files>\tattach files to the message\n\
   -b <address>\tspecify a blind carbon-copy (BCC) address\n\
   -c <address>\tspecify a carbon-copy (CC) address\n\
   -D\t\tprint the value of all variables to stdout");
@@ -149,7 +149,7 @@
   -Z\t\topen the first folder with new message, exit immediately if none\n\
   -h\t\tthis help message");
   puts _("  --\t\ttreat remaining arguments as addr even if starting with a 
dash\n\
-\t\twhen using -a with multiple filenames using -- is mandatory");
+\t\twhen using both -a and addr, using -- is mandatory");
 
   exit (0);
 }