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

Re: How about separating "_arguments --" into a new function?



Jun T wrote on Mon, Oct 18, 2021 at 13:40:09 +0900:
> 
> > 2021/10/18 1:49, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > 
> >>>> Or just using $_args_cache_cmd is enough?
> >>> 
> >>> If it is enough, then it should be made more discoverable.
> >> 
> >> I guess it is enough since no one is requesting to separate _arguments.
> >> How about the following?
> >> 
> > 
> > Are we happy with documenting it as a first-class feature, i.e., one
> > that we would be expected to continue supporting?  Or would we rather
> > document this as a "we may change this in the future" thing?
> 
> I personally feel we don't need to document it (it's a kind of hidden
> feature). But you said it should be more discoverable. So where should
> it be documented? At the end ofEtc/completion-style-guide? Or as a
> comment at the top of _arguments?

Happy to leave the decision to you.  Either of these options sounds good
to me.

> > Would prefer «print -r --» in case of backslashes,
> 
> I think (qqq) takes care of backslashes etc., but will use print -r
> if it looks safer.

It's not just "looks safer"; it's a matter of correctness.  The content
of ${_args_cache_foo} need to be escaped once for their transit through
lex.c when _foo will be read by compinit, and once against «echo»'s
treatment of backslashes.  Thus, «print -r --» should be used _in
addition_ to ${(qqq)}, not instead of it.

Cheers,

Daniel




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