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

Re: question about "-E" option of compadd



On Sun, Apr 24, 2016 at 09:36:00PM -0700, Bart Schaefer wrote:
> On Sun, Apr 24, 2016 at 8:07 PM, Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx> wrote:
> >
> >     And because all but one empty string would otherwise be removed,
> >     this  option implies  the  -V  and  -2 options (even if an
> >     explicit -J option is given).
> >
> > But isn't the action "all but one empty string be removed" implying a
> > "-1" option? "-2" option should keep all empty strings I think.
> 
> Note the word "otherwise" in the "And because ..." sentence.
> "Otherwise" in this context means "if -E were not used".
> 
> "And because all but one empty string would be removed if -E were not
> used, it is the case that -E implies -V and --2."

Thanks. But looks like even if -E was used, all but one empty strings
still being removed ? like this:

% _foo()
compadd -E 3 foo1 foo1 foo1 foo2 foo3 '' '' ''
% compdef _foo foo
% foo <tab>
   foo1 foo2 foo3


there is only one empty string showed.

Thanks in advance.



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