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

_arguments -n / $NORMARG (was: Re: [PATCH 1/2] __arguments: New completion function for _arguments.)



Daniel Shahaf wrote on Thu, Apr 01, 2021 at 17:33:05 +0000:
> Oliver Kiddle wrote on Thu, Apr 01, 2021 at 14:53:02 +0200:
> > You wrote:
> > > +    '-n[set $NORMARG]' \
> > 
> > -n should not be used, it is fundamentally broken and will never be
> > fixed because the right answer to $NORMARG as it is defined can be a
> > list of possibilities. It grabs an internal variable from the first
> > element of a linked-list and dumps it out. The problem it was added to
> > solve would have had better solutions.
> > 
> > Could hide it with ! or add a comment.
> > 
> 
> I'll add !, and we should document that in the manual too if it isn't
> already.

The manual doesn't already include such a warning, but I don't
understand how exactly $NORMARG is broken, so I can't document that.
Could you elaborate on what cases «_arguments -n», as implemented, would
cause breakage in?

The comment above the definition of the linked list's type (struct
castate) says the list comprises one node per set.  Does that refer to
_arguments option sets?  If so, perhaps -n is fine to use so long as
option sets aren't also used?

Cheers,

Daniel




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