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

Re: "antecedents" [was Re: a couple of completion questions]



Clint Adams wrote:

> > Sorry, I don't understand... what do you want to do?
> 
> Okay.  I want to use _arguments -A in the state switch at the bottom.
> Originally, install and record_avail were the same case, but when I
> added -A, they wouldn't complete, so I had to insert the options
> that had gotten the user to that state, which is why install and
> record_avail are two separate cases now.
> 
> I want to avoid making remove, purge, status, and listfiles
> four separate cases, yet still retain the -A to _arguments.
> My last resort would probably be to define four new arrays with
> the short and long options and then use something like
> ${(P)${:-_dpkg_actions_${state}}}, but I was hoping that there
> was a better way.

Aha. Well, if it finds a string not described by one of the
option-specs it has to take it to be an argument.

Hm, should we add an option, to be combined with -A (or an argument to 
-A?) to tell it that it should consider words starting with [-+] to be 
arguments? Or, probably better, let -A take an argument, a pattern and 
all words matching it are not taken to be arguments and hence don't
keep it from completing option.


Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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