Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

global alias as function - "--attach"

can i use a global alias as a function within a command?

the real problem:
someone asked (yet again) whether mutt (the mailer)
can attach a list of files or a directory of files.
this is not possible yet - mutt can only attach files given
on the command line when *every* file is preceded by "-a".

a patch might get this to work (as usual).
however, i can imagine something like this:

  mutt --attach file dir/ -xyz

here, the "--attach" would be a global alias
which test the following parameters for
files and files within directories.

if these are existing files and directories then
they are simply attached each file (or file within
a given directory) by expanding it to "-a file":

  mutt -a file -a dir/file1 -a dir/file2 -xyz

however, i am not sure how this can be achieved.
the global alias might contain a backtick, of course -
but where should the closing backtick come from? hmm..

maybe there is an even simpler way of solving this.

i have to admit that i did not do any
manual reading or searching the web.
if this has been discussed before
then i'd appreciate some pointers.
key words, URLs etc are fine.
thanks! :-)


Messages sorted by: Reverse Date, Date, Thread, Author