Grant Edwards wrote: > Nicolas Williams wrote: > > 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... > > And since there _is_ a convention that '--' ends the option list, it's > A Bad Thing(TM) to use it for something else. I think violating the > almost universal convention about what '--' means is a terrible idea, > but apparently we're now stuck with it.
Having just happened upon this myself I am now one of the many saying that mutt has made a terrible mistake with this implementation. The '--' is an end of option argument processing. It should not be used as an end of list marker. It should be used as an end of argument option marker. > The standard way to pass a list of filenames on a command line is to > do it indirectly by putting the filenames in a file, and passing that > filename. That seems to work fine for dozens (or hundreds) of other > programs, so I don't see any reason why mutt shouldn't follow that > convention. The problem mutt is facing is one of in-band-control. The marker needs to not match any filename. But what if you have a file named "--"? (Don't laugh. People do things like this. And then then ask how to remove it. Really! ["rm -f ./--", or "rm -f -- --") It is hard to do in-band-control well. Especially on Unix-like filesystems where the only two invalid characters are the null character and slash. One way is just to assume that a particular filename will never be supported. Something like "--" but "--" is a terrible choice. I would have preferred that "+" were chosen. mutt -a * + j...@example.com That seems to have a low likelihood of collision with a real filename. It is used by 'find' and standardized by POSIX. As in this example "find . -exec echo {} +". And so isn't completely unknown elsewhere. But since only null and slash are invalid perhaps that is the best clue. mutt -a * / j...@example.com Ugly. But seems least ambiguous to me. And it avoids the in-band control problem. Bob
signature.asc
Description: Digital signature