Re: [QUERY] How do you sort completions?
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- May 24, 2013, 13:11 UTC
- Message-ID
- <CAMP44s3_BBPu0WSzYyaVLbdg0dBuaV7MFgy1SMuK1C8P2vKbYg@mail.gmail.com>
- In-Reply-To
- <CALkWK0k=nVHOBe5SgRH9xQK1+yAYBzbNMqsWxhYPo0MTZPp63g@mail.gmail.com>
On Fri, May 24, 2013 at 6:33 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
Show 14 quoted lines
> Hi, > > I'm not able to sort completions for some weird reason. No matter > what I order I insert stuff into COMPREPLY, bash seems to auto-sort > them lexically. I tried to pass --sort='-committerdate' to git > for-each-ref so I can get a sensible 'git checkout <TAB>' reply, and > I'm very annoyed that it doesn't work. > > I thought it was bash's complete builtin doing the implicit sorting, > so I read the manual with no success. Is readline doing it? If so, > why am I not getting the ordering even in zsh (which doesn't use > readline)? > > What am I missing?
AFAIK bash needs the completions sorted, so we added some | sort | uniq. I suppose zsh doesn't need that, but have you tried by calling compadd directly?
-- Felipe Contreras