On Mon, Aug 02, 2010 at 04:26:47PM -0500, Nicolas Williams wrote:
> On Mon, Aug 02, 2010 at 04:13:16PM -0500, Will Fiveash wrote:
> > On Mon, Aug 02, 2010 at 03:49:47PM -0500, Nicolas Williams wrote:
> > > On Sun, Aug 01, 2010 at 10:52:01PM -0500, David Champion wrote:
> > > > Syntax has been changed: -a indicates a *list* of attachment files
> > > > ending with "--". I don't recall which version was first to boast this
> > > > new syntax, but it's the problem you're seeing right now even if it's
> > > > not related to the problem you saw earlier.
> > > >
> > > > Try:
> > > >
> > > > mutt -s test -a Bild.jpg -- [email protected] <body.txt
> > >
> > > I recommend against this use of '--'. It makes it harder to write
> > > wrapper scripts that parse the same arguments using getopt/ getopts, for
> > > example. Sadly, I don't have a counter-proposal, nor am I suggesting
> > > this get ripped out now.
> >
> > On the other hand it makes:
> >
> > mutt -a * -- [email protected]
>
> Really? You do that? It's kinda like rm *...
I haven't yet but I could see if one was in a dir with images like
foo.jpg bar.jpg etc... it could be useful. I'm not saying one should
use it without caution.
> > easier which I would guess is why the change was made. You do have a
> > point about -- being potentially problematic. Maybe -a should work like
> > it used to (only one file per -a instance) and a new flag could take a
> > list of files to attach from a file given as a arg (or stdin).
>
> Right. There's no good convention for "end of list of arguments to an
> option". There's only a good convention for "end of variable argument
> list" ('--'), and since this is the closest thing...
>
> If -a was last then you could:
>
> % mutt -s some-subject -t some-to:-addres ... -a * < body.txt
>
> Oddly enough there's no -t argument. The To: address(es) has(have) to
> be last. You can't have two argument lists terminated by dint of being
> last.
Yeah, I hate positional CLI args. I'd prefer:
% ls *.jpg > /tmp/files
% mutt -s some-subject -t to:-address1,to:address2 -q /tmp/files -c cc:-address
< body.txt
--
Will Fiveash
Oracle
Austin, TX, USA
Internal Solaris Kerberos/GSS/SASL website: http://kerberos.sfbay.sun.com
http://opensolaris.org/os/project/kerberos/
Note my new work e-mail address: [email protected]