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

Re: [PATCH] Completion: Fix use of -A and -S options to _arguments



dana wrote:
> Patch #2: Make use of the -A and -S options to _arguments consistent in these
> functions.
>
> I can't think of any reason you would ever *not* want to use -S for these, but

Generally, it's purely a question of does the command-line parser for
the command in question allow options after ???--???.

> someone did go out of their way to make it conditional in _ln ??? if anyone
> knows why that might be, please tell me.

I went to check on the assumption that it was likely to have been me
but it wasn't. Given that it is done conditionally for GNU, I'd guess that
???-S??? got confused with ???-A "-*"???. In general, GNU tools tend to allow
options after other arguments while it is less common elsewhere. -- is
more widely recognised.

> Aside: The use of *:: in _ln and _rm prevents those functions from offering
> options after an operand has been given. I can't recall if this behaviour has
> ever been discussed here before ??? is there a way to deal with it?

It is behaviour I was aware of and know that I thought about it when I
was making changes to the comparguments. There were at least a couple of
such oddities that I was reluctant to change for backward compatibility
reasons and there may have been reasons for it that are apparent when
you dig into the code. In combination with a state, it isn't really
fixable. I don't remember if it has been explicitly discussed as such.

Oliver



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